Oh shift! I used to do this stuff all the time... a long time ago,
This shouldn't need to be "small"... but to try to make it the same...
; nasm -f obj program.asm
; link program.obj ; ?
; nasm doesn't use "model"
;.model small
section stack stack ; first "stack" is name, second is attribute
resb 100h
section .data
Asterisks DB '*****',0DH,0AH,'$'
section .code ; nasm knows ".text" but not for -f obj
..start ; for -f obj only!
; Main Proc ; not for nasm
mov ax, .data
mov ds, ax
mov cx, 5
_loop1:
mov ah, 9
lea dx, [Asterisks] ; "lea" wants "[contents]"
int 21H
dec cx
jnz _loop1
; or just 'loop loop1' decrements cx and jumps if non-zero
; exit cleanly
mov ah, 4ch
int 21h
; Main ENDP ; not for nasm
;END Main ; not for nasm
This prints out:
*****
*****
*****
*****
*****
Untested! I think that's right. Holler if any problem or if you want to make a '.com' file out of it (model tiny).
Code tags: put the word "code" in square brackets, "/code" it the end. Makes it easier to read? and easier to cut and paste!
Best,
Frank