Member Avatar

Preconditions: Addresses of 2 integer variables are on the stack as the parameters. Sample c call: swap( &num1, &num2); You must implement the following C swap function: /* Swaps the two values pointed to by x_ptr and y_ptr. */ void swap (int *x_ptr, int *y_ptr) { if (x_ptr != y_ptr) { *x_ptr ^= *y_ptr; /* note that ^ means xor */ *y_ptr ^= *x_ptr; *x_ptr ^= *y_ptr; } } Postconditions: The values of the two integer parameters have been exchanged.

Member Avatar
+0 forum 6
Member Avatar

I am currently making out the plans for the milestones for the rest of this year in my long-term projects (Thelema, Assiah, and Alfheim). I was hoping that someone would be able to review these plans and help me determine which are feasible in the next four months. The overall goal, which I project to take at least until the end of next year, is to develop a rudimentary compiler and REPL for my language project, [Thelema](https://github.com/Schol-R-LEA/Thelema). I am currently focusing on the lower-level toolchain which will support the language, which will consist of an assembler, [Assiah](https://github.com/Schol-R-LEA/Assiah), and a library …

Member Avatar
+0 forum 1
Member Avatar

Hi everyones! I have explore and development on many programming languages as C++, python, perl, java(a little bit) and Assembly (a little bit),and web languages like html, javascript(a little bit) and PHP. Now I'm wanna create my own OS. My OS will have a simple boot file as starting up a command prompt as reading a main script file as running all other stript files ass will build the hole operating system. the biggest problem is, I don't now how to build the boot sector. I've try to create a assembly boot file and convert it to a .bin file, …

Member Avatar
+0 forum 7
Member Avatar

There is free tools to do the same, but I was curious to see what it takes to make one myself. For info see: [url]http://en.wikipedia.org/wiki/LC-3[/url]

Member Avatar
+5 forum 10
Member Avatar

SO guys I am supposed to be making a program that will check for a palindrome but, I can not get my code to work. It seems to be stuck on the cmp part. I am not sure if this is even right I dont have much experience with masm. Any help would much be appreciated segment .data s DB 'malayalam' s_size DW 9 pal db "is a plaindrome",0x0a,0 segment .text global main extern printf main: lea rdi, [s] ;move string into rsi mov rsi, rdi ;set rsi to rdi add rsi, s_size ;add the 9 to rsi dec rsi …

Member Avatar
+0 forum 2
Member Avatar

Yesterday while browsing the web, I stumbled upon a blog where the author had written a post regarding what a computer scientist should know, in that list he had given links for further reading. One of these links was to a website [nand2tetris](http://nand2tetris.org/) where the goal is supposedly to build a modern computer from first principles! This seems very interesting to me, and I would like to ask whether anyone here has tried, or would recommend this project. In a video he says it could be completed in 12 weeks, is this an accurate estimate? If so I would perhaps …

Member Avatar
+0 forum 2
Member Avatar

Guys! I would like to know if it was possible to create an assembler using python since it has excellent string handling features. Any Ideas how it could be done?

Member Avatar
+0 forum 2
Member Avatar
Reusable Code Snippet 2-digit Fibonacci Solver (NASM)

I bet all Computer Science related courses would learn low level or machine level languanges in due time and in our university we used the portable 80x86 assembler NASM for our Assembly code So here's my experimentation on how to use "functions" and recursion using a Fibonacci Solver as a test case As you may notice the code only output the final outcome of the Fibonacci sequence instead of printing every number for all steps. I might or might not update this depending on my free time and motivation but for now here's what i've done :)

+0 forum 0
Member Avatar

Hello everyone.. i am quite new to TASM.. i desperately need help with a few programs.. will rilly be grateful if u can provide me the code for them... **Using 32-bit processor and assembler develop programs:** 1) WAP to read a 32-bit interger, store that number in EAX register and display it digit by digit. 2) Repeat 1) for 64 bit number using 2 32-bit registers. 3) WAP to find factorial of a number where result does not exceed 64 bit. Use procedure to calculate factorial and pass parameters. 4) Write modular program to perform addition, subtraction, multiplication and division …

+0 forum 0
Member Avatar

Hey guys, anyone know how to setup FASM on geany so the compile and the execute will work? This is what I currently do: Compile: `./fasm "%f"; chmod a+x %e.com` Execute: `./%e.com` When I compile it, it seems to be okay. When I execute, however, it gives this: `�: not found` anyone know what to do?

Member Avatar
+0 forum 1
Member Avatar

I need help how to solve this task, I don't know how to solve first part which is for memory location. If someone know please help me. It is very important.. ENTRY RESULTS entrance examination: In memory location X is placed in an entrance exam results in the form: Indeks - 2 bytes points - 1 byte Create a program in 8086, so that the screen will read the number of students placed in memory and then the location PRIEMEN will print the screen line by line <INDEKS1>, <POINTS1> <INDEKS2>, <POINTS2> <INDEKS3>, <POINTS3> <INDEKS4>, <POINTS4> ... For printing use the …

Member Avatar
+0 forum 2
Member Avatar

Hey all, admittedly this is some homework help. I'm trying to write a program which takes a string in of hex characters, calls an assembler function which gives me the decimal value of the hex string. That assembler function calls a "checker" function in C which makes sure each character is a legal HEX value. My question is two fold, how do I take an EBX register in assembler and properly pass it to a C function expecting a character. I can't seem to properly pass from assembler back to C: [CODE] #include <stdio.h> #include <string.h> int main(void) { char …

Member Avatar
+0 forum 1
Member Avatar

I am a beginner in learning assembly language. I wanted to know which assembler would be best to use between NASM and MASM in today's context. Also, can you give a link to documentation on these assemblers?And tutorial specific for these assembler (as assembly is not standardized)

Member Avatar
+0 forum 3
Member Avatar

Choose in the following to make a ASSEMBLY LANGUAGE PROGRAM in EMU8086 .. Analyze and make a program on the ff. problms. 1. Given is based on the given average and their assign grade a. If average is greater than or equal to 90, assign remarks is outstanding. b. If not, if average is greater than or equal to 80, then assign remarks is above average. c. If not, if average is greater than or equal to 70, then assign remarks is average. d. If not, if average is greater than or equal to 60, then assign remarks is satisfactory. …

-1 forum 0
Member Avatar

Help me plz... I need it BADLY.. And ASAP ... :( This for emu8086 ... 1. Given is based on the given average and their assign grade a. If average is greater than or equal to 90, assign remarks is "outstanding". b. If not, if average is greater than or equal to 80, then assign remarks is "above average". c. If not, if average is greater than or equal to 70, then assign remarks is "average". d. If not, if average is greater than or equal to 60, then assign remarks is "satisfactory". e. If not assign remarks "poor". 2.In …

Member Avatar
+0 forum 1
Member Avatar

Here I have code in C, I need help to translate this in assembly emu 8086. Please help me if you know. [CODE]#include <stdio.h> #include <stdlib.h> int main(void) { int **mat; // Pointer to pointer int rows, cols, i, j; printf("How many rows you want "); scanf("%d", &rows); //rows = 10; //cols = 10; mat = malloc(rows*sizeof(int*)); // array of number of rows printf("How many cols "); scanf("%d", &cols); for (i=0; i<rows; i++) { // for each row ... mat[i] = malloc(cols * sizeof(int)); // add these many cols } for (i = 0; i<rows; i++) { for (j = …

+0 forum 0
Member Avatar

I need to know how to do a assembly program that accepts a string with the Instruction format and understand it and then execute it Input: String as“mov eax,10” Output: The string instruction will be executed.

Member Avatar
+0 forum 1
Member Avatar

Hello, I need help for my task.. This is the matrix 1 2 3 4 5 6 7 8 9 the result is 1,4,7,8,9,6,3,2,5 I have to solve this task in assembler 8086 in emu... I need help, it is very important for me. Please help me

Member Avatar
+0 forum 6
Member Avatar

I am creating a simple Operating System called OneFileOS, and I am wondering if I must use a special version of assembler, or if I can use the regular x86 version. Thank You.

Member Avatar
+0 forum 1
Member Avatar

You can use and assemble with MASM611 very easily in Notepad++. Ihave find a very nice customization of Notepad++ on a blog. You can find it at [URL="http://easymasm.blogspot.com/"]http://easymasm.blogspot.com/[/URL]

Member Avatar
+0 forum 2
Member Avatar

I have a subroutine that is passed a pointer to a bit string in the si reg and an index in the ax register. I declared the val variable in the data seg [CODE]getbit: cmp ax, 1783 ; max value of the index being passed ja goback push si mov [val], ax add si,val mov ax,[si] pop si goback:ret [/CODE] Is what I have, but it's not giving me the expected value, any help would be appreciated.

Member Avatar
+0 forum 2
Member Avatar

heres my C code this was easy: -Chris g [CODE=c]#include <stdlib.h> #include <stdio.h> extern int numodd( int array[], int size ) ; int main( int argc, char * argv[] ) { int numarray[] = { 2, 3, 1025, 3024, 4057, -3, -1025, -3578 } ; int size = sizeof(numarray) / sizeof( int ) ; int result ; result = numodd( numarray, size ) ; printf( "Number of odd numbers: %d\n", result ) ; exit( 0 ) ; }[/CODE] ARM CODE: [CODE].global numodd .text numodd: stmfd sp!, {v1-v6, lr} @load from memory mov v1, #0 mov v1, a2 @store mov v2, …

Member Avatar
+0 forum 1
Member Avatar

Is it possible to use [URL="http://msdn.microsoft.com/en-us/library/45yd4tzz%28v=VS.80%29.aspx"]__asm blocks[/URL] with Code::Blocks IDE? And if so how??

Member Avatar
+0 forum 1
Member Avatar

This is my OS that I've been working on for almost 3 months now (not all at once.. in periods of a few days each time). Would anyone skilled in NASM mind looking at parts of it and give me their opinion on my code? Note that there are many files; I'll do my best to organize it all right here. Anybody can use any of this code as long as my name is in the credits. :) [URL="http://pastebin.com/sEutJFwS"][COLOR="Red"]Boot.asm[/COLOR][/URL] [COLOR="Green"]--[/COLOR] [URL="http://pastebin.com/Ft5GSs3A"][COLOR="Red"]Kernel.asm[/COLOR][/URL] [URL="http://pastebin.com/DDdV4eer"][COLOR="Red"][COLOR="Red"]Includes.asm[/COLOR][/COLOR][/URL] [COLOR="Green"]--[Kernel][/COLOR] [URL="http://pastebin.com/QfrZn5iS"][COLOR="Red"]Calls.asm[/COLOR][/URL] [URL="http://pastebin.com/KSvrXCNv"][COLOR="Red"]Macros.asm[/COLOR][/URL] [COLOR="Green"]--[Kernel menu stuff][/COLOR] [URL="http://pastebin.com/NJsYVas4"][COLOR="Red"]Buttons.asm[/COLOR][/URL] [URL="http://pastebin.com/DK7Y1ugi"][COLOR="Red"]Core.asm[/COLOR][/URL] [URL="http://pastebin.com/n7T09QLe"][COLOR="Red"]Msgbox.asm[/COLOR][/URL] [URL="http://pastebin.com/w2LF2D4d"][COLOR="Red"]Textbox.asm[/COLOR][/URL] [COLOR="Green"]--[Kernel game engine][/COLOR] [URL="http://pastebin.com/4aG83ZRv"][COLOR="Red"]Engine.asm[/COLOR][/URL] [URL="http://pastebin.com/hTmQSp2m"][COLOR="Red"]#Macros.asm[/COLOR][/URL] [URL="http://pastebin.com/uYSbE2fd"][COLOR="Red"]Crate.asm[/COLOR][/URL] [URL="http://pastebin.com/XxSUrLCg"][COLOR="Red"]Fences.asm[/COLOR][/URL] [URL="http://pastebin.com/X40Csavm"][COLOR="Red"]Player.asm[/COLOR][/URL] …

Member Avatar
+1 forum 2
Member Avatar

I am new to assembly. I found this code here [url]http://www.daniweb.com/software-development/assembly/threads/117744[/url] What I am having trouble with are the following lines [CODE]L0_95: ; this segment prints ASCII code 0 - 95 mov si,6 ; refers to the string we declared at the beginning mov cx,4 ; I think this is the height? C1A: ; this loop adds the name of the column mov al,string[0] mov es:[si],al mov al,string[2] mov es:[si+6],al mov al,string[4] mov es:[si+24],al mov al,string[6] mov es:[si+28],al add si,40 ;;;; what is this line? loop C1A mov si,122 ;;;; and these three lines? mov bx,0 mov cx,4 C1B:push cx …

+0 forum 0
Member Avatar

Hi! im trying to make a procedure wich saves what is on screen in a variable defined on the data segment (antes dw 2000 dup (?)). It compiles well but it freezes the program when it is called by it(program). BTW: this program is in textmode 80x25 16-bit and i am not allowed to use BIOS or DOS interruptions: [CODE] ;Saves the screen image insede a rectangle ;in variable antes on the data segment. ;gets the upper left corner of the rectangle from bx ;gets the lower right corner of the rectangle from ax ;the rectangle's width in cx ;|------cx---------| …

Member Avatar
+0 forum 5
Member Avatar

Here is my code [code].section .data values: .int 0 array_end: .equ ARRAY_SIZE, array_end - values array_fmt: .asciz " %d" usort_str: .asciz "unsorted array:" sort_str: .asciz "sorted array:" newline: .asciz "\n" maxvalue: .int 1000 format: .asciz "%d" message: .asciz "Please enter a maximum size for the array to be sorted." output: .asciz "The length is '%d' \n" val_fmt: .asciz " %d" .section .bss .comm buffer, 4000 .section .text .globl main main: pushl $message call printf addl $4, %esp pushl $maxvalue pushl $format call scanf addl $8, %esp movl $buffer, %edi movl maxvalue, %edi pushl maxvalue pushl $output call printf addl $8, …

+0 forum 0
Member Avatar

Hi, im trying to print a "$". I tried using: msj db "Hola", 36 msj db "Hola \$", '$' msj db "Hola \\$", '$' But none of them worked.. Help please

Member Avatar
+0 forum 3
Member Avatar

Good Morning... Where to start? Well, I live near San Francisco, California. Married for almost 40 years, two kids (all grown up), two grandchildren ( 6 and under). My career started in 1966 at IBM as a Field Engineer on very large, water cooled, mainframes. I've had to reinvent myself a number of times during my working life. Moving from hardware to mainframe system programming to mainframe assembler language programming and finally to Linux. My latest career incarnation is that of a Linux System Administrator. I've been doing that since the Iggdrasil (did I spell that right?) distribution which came …

Member Avatar
+0 forum 3
Member Avatar

Hey everyone, my first post here, so lets see if I do this right. So I have this assignment that links a fibonacci.c, fib.h, and fib.s file. The assignment is supposed to be done by compiling all of the files, then running ./fibonacci <n> where <n> is the n'th term that should be printed out of the fibonacci sequence. Here's what I have so far: my fibonacci.c: [CODE]#include <stdio.h> #include "fib.h" int main(int argc, char*argv[]){ int x; x=atoi(argv[1]); printf("%d\n",fib(x)); return 0; }[/CODE] fib.h, which was provided for the assignment: [CODE]#ifndef _FIB_H_ #define _FIB_H_ extern int fib(int n); #endif [/CODE] and …

Member Avatar
+0 forum 2

The End.