Well, I though I knew what I was doing, but apparently, I don't because I wanted to make this one simple code that would add 1 to the value of color 0 every frame, which was supposed to start out white, but it doesn't work in that it starts out at the default color black. Have any ideas?
Code:
;========================================================================
;Section IVT
;========================================================================
cpu 80186
section ivt start=0 ; you will need this later
idt:
dw diverr_handler, (section.code.start >> 4)
dw brk_handler, (section.code.start >> 4)
dw nmi_handler, (section.code.start >> 4)
dw int3_handler, (section.code.start >> 4)
dw into_handler, (section.code.start >> 4)
dw bound_handler, (section.code.start >> 4)
dw undefinst_handler, (section.code.start >> 4)
dw nocoprocessor_handler, (section.code.start >> 4)
dw vbl_handler, (section.code.start >> 4)
dw sprbuf_handler, (section.code.start >> 4)
dw raster_handler, (section.code.start >> 4)
dw sound_handler, (section.code.start >> 4)
dw def_handler, (section.code.start >> 4)
dw def_handler, (section.code.start >> 4)
dw def_handler, (section.code.start >> 4)
dw def_handler, (section.code.start >> 4)
dw coprocessorerror_handler, (section.code.start >> 4)
dw def_handler, (section.code.start >> 4)
dw def_handler, (section.code.start >> 4)
dw def_handler, (section.code.start >> 4)
dw def_handler, (section.code.start >> 4)
dw def_handler, (section.code.start >> 4)
dw def_handler, (section.code.start >> 4)
dw def_handler, (section.code.start >> 4)
dw def_handler, (section.code.start >> 4)
dw def_handler, (section.code.start >> 4)
dw def_handler, (section.code.start >> 4)
dw def_handler, (section.code.start >> 4)
dw def_handler, (section.code.start >> 4)
dw def_handler, (section.code.start >> 4)
dw def_handler, (section.code.start >> 4)
dw def_handler, (section.code.start >> 4)
dw vbl_handler, (section.code.start >> 4)
dw sprbuf_handler, (section.code.start >> 4)
dw raster_handler, (section.code.start >> 4)
dw sound_handler, (section.code.start >> 4)
;========================================================================
;Section Code (Pointers)
;========================================================================
section code vstart=0 align=16
diverr_handler:
iret
brk_handler:
iret
nmi_handler:
iret
int3_handler:
iret
into_handler:
iret
bound_handler:
iret
undefinst_handler:
iret
nocoprocessor_handler:
iret
vbl_handler:
iret
sprbuf_handler:
iret
raster_handler:
iret
sound_handler:
iret
def_handler:
iret
coprocessorerror_handler:
iret
;========================================================================
;Section Code (Main Code)
;========================================================================
main_code:
;Set Stack Location
mov sp, 0xe000
mov ss, sp
mov sp, 0x0000
;White Color Upload
mov di, VideoHardwareRamStart
mov es, di
mov di, PaletteRam
mov dx, 0xFFFF
mov [0x0000], dx
sti ;Enable Interupts
infinite_loop:
mov dx, [0x0000]
add dx, 0x0001
mov [0x0000], dx
hlt
jmp infinite_loop
;========================================================================
;Section Data
;========================================================================
section data vstart=0 align=16
;========================================================================
;Section Reset
;========================================================================
section reset start=0x7FFF0 vstart=0
cli
jmp (section.code.start >> 4):main_code
times 16-($-$$) db 0
;========================================================================
;Section RAM
;========================================================================
segment bss start=0xE0000 vstart=0 nobits align=16
;Define Stuff:
WorkRamStart equ 0xE000
VideoHardwareRamStart equ 0xF000
SpriteRam equ 0x8000
PaletteRam equ 0x8800
SpriteControlRam equ 0x9000
ScreenWidth equ 320
ScreenHieght equ 240
I think I just totally forgot how 20 bit addressing works...