;============================================================================== ;file :marble.asm ;author :Andre Long ;due :April 19, 2006 ;description :This program will use arrays to calulate prime numbers ;============================================================================== ;Procedures To INCLUDE Pcmac.inc ;macros EXTRN NEWLINE:FAR ;display a new line EXTRN GETDEC$:FAR ;gets 16-bit decimal number EXTRN PUTDEC$:FAR ;display 16-bit decimal number EXTRN PUTSTRNG:FAR ;display a string EXTRN xyConvertor: FAR ;============================================================================== .MODEL SMALL .586 .STACK 100h ;============================================================================== .DATA maxcups EQU 49 cups DB 50 DUP (0) blank DB ' ', '$' step DB ? messtest1 DB 'made it!', '$' messtest2 DB 'Hello', '$' ;============================================================================== .CODE marble proc _Begin mov bx, 0 start: cmp bx, maxcups mov al, 1 jbe loopA jmp doneA loopA: mov [cups + bx], al inc bx jmp start doneA: mov bx, 0 mov ah, 0 startB: cmp bx, maxcups jbe loopB jmp doneB loopB: mov al, [cups + bx] call putdec$ ;sPutStr blank inc bx jmp startB doneB: mov step, 1 mov bx, 0 mov dx, 1 call newline startOutter: inc dl cmp dl, maxcups jbe startC jmp doneC startC: ;THIS IS WERE THE ARRAY IS CHANGED cmp bx, maxcups jbe loopC jmp doneC loopC: cmp step, maxcups jbe loopCC inc bx jmp startOutter loopCC: mov bh, 0 mov bl, step mov al, [cups + bx] call xyConvertor mov [cups + bx], al add step, dl jmp loopC doneC: mov bx, 0 startBB: ;THIS WERE THE ARRAY IS PRINTED OUT AFTER CHANGE cmp bx, maxcups jbe loopBB jmp doneBB loopBB: mov al, [cups + bx] mov ah, 0 call putdec$ inc bx jmp startBB doneBB: _Exit marble endp end marble