Message board for the users of flat assembler.
> DOS > Newbie : DOS program from a book wont run
Goto page 1, 2, 3, 4, 5, 6 Next
I am reading a book called : x86 assembly language and C fundamentals, by J. Cavanagh. I have read the usual basics, and made some small C programs that runs. Now I am on page 200 in the book, and examples proceedes in assembly. And again, equally lost as I were when getting a C program to run, the asm wont run. The book suggests flat assembler. I get errors on every line. Error on capital letters, and error on the "proc far".
I tried to make the capital letters into small letters
and add this include 'win64ax.inc', but no function.
This is the code, in exact type from the book.
;swap_bytes.asm ;-------------- .STACK ;-------------- .DATA TEMP DB ? ;DB=define bytes ;$ delimiter meaning end of string RSLT DB 0DH, 0AH, 'BL = , BH = $' ;-------------- .CODE BEGIN PROC FAR ;set up pgm ds MOV AX,@DATA ; place .DATA addr in ax MOV DS,AX ;assign values to bl and bh MOV BL,'A' MOV BH,'B' ;store bl in temp area before swapping MOV TEMP, BL ;swap registers MOV BL, BH MOV BH,TEMP ;move registers to result area for display MOV RSLT + 7,BL MOV RSLT + 15,BH ;print result MOV AH,09H ;display string MOV DX, OFFSET RSLT ;rslt address must be in dx INT 21H ;a dos interrupter that uses fctn