Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

brandnew to assembly & programming

Status
Not open for further replies.

sscuba22

Technical User
Oct 6, 2002
1
US
hi .
i am trying to make a write records routine to output last in first out.
I have a table initialized to (20 records of 21 bytes each )
of *.
I can output the records lastin first out BUT i am also outputing all the initialized aread of the table -all the *.
any input would be much appreciated.
Thanks


; Write All Records in TABLE on the users Screen
; [ LAST In, First Out (FIFO) sequence ]

Write_Recs:

Mov DX,OffSet Table ;Set DX to point to Table

Add DX,420D ; point to end of possible Table



Mov CX,20D ;Set Loop counter to MAX #Recs input


a: Sub DX, 21D ; go to beginning of LAST line
Cmp DX, 42D ; this doesn't help!!
JE a

Mov AH,9 ;Set AH for DOS String Output

P_Loop:


Int 21H ;Write the record to the screen
Sub DX,21D ;Set DX to point to next record
Push DX ;save DX on the stack
Mov DX, OffSet Cr_Lf ;set up write
Mov AH, 9 ;DOS write <CR><LF> to screen
Int 21H ;

Pop DX ;restore DX (from the stack)

Loop P_Loop ;go write another one until done...

; Output of Table to Screen complete...

Mov AX,4C00H ;setup for return to DOS
Int 21H
Ret
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top