Article ID: 111474
Article Last Modified on 10/14/2003
111473 BUG: ORG in STRUCT Affects Current Segment Size with -Sf
; Assemble options needed: none
.MODEL SMALL,C
.386
VIDEOMEM EQU 0B800h ; segment address of video memory
NUMLINES EQU 25
NUMCOLS EQU 80
BLACKONWHITE EQU 70h ; display attributes
YELLOWONBLUE EQU 1Eh
status STRUCT
org (NUMLINES - 2) * NUMCOLS * 2
line1 db ?
attrib1 db ?
org (NUMLINES - 1) * NUMCOLS * 2
line2 db ?
attrib2 db ?
status ENDS
.STACK
.DATA
msg1 db "This is the first status line, "
db "with yellow characters on a blue background."
lenmsg1 dw $-msg1
msg2 db "This is the second status line, "
db "with black characters on a white background."
lenmsg2 dw $-msg2
.CODE
.STARTUP
mov ax, VIDEOMEM
mov es, ax
mov cx, NUMCOLS
xor di, di
@@:
mov es:[di].status.attrib1, YELLOWONBLUE
mov es:[di].status.attrib2, BLACKONWHITE
inc di
inc di
loop @B
xor si, si
xor di, di
mov cx, lenmsg1
@@:
mov al, msg1[si]
mov es:[di].status.line1, al
inc si
inc di
inc di
loop @B
xor si, si
xor di, di
mov cx, lenmsg2
@@:
mov al, msg2[si]
mov es:[di].status.line2, al
inc si
inc di
inc di
loop @B
.EXIT
END
Additional query words: 6.00 6.00a 6.00b 6.10 6.10a 6.1x
Keywords: KB111474