RosettaCodeData/Task/Host-introspection/8086-Assembly/host-introspection.8086
2023-07-01 13:44:08 -04:00

26 lines
566 B
Text

.model small
.stack 1024
.data
UserRam BYTE 256 DUP (0)
.code
start:
mov ax,@data ;assembler calculates this offset for us
mov ds,ax ;the 8086 can only load segment registers from other registers, not directly from immediate values.
mov ax,@code
mov es,ax
mov ax,3422h
mov word ptr [ds:UserRam],ax
mov bl, byte ptr [ds:UserRam]
call doMonitor ;a routine that prints the contents of
;the 8086's registers to the screen
mov ax,4C00h
int 21h ;return to MS-DOS
end start