Page 1 of 1

What is a "slot" in wla dx assembler?

Posted: Sun Jul 03, 2005 2:33 am
by blargg
What are memory slots in the wla dx assembler?

Continuing from http://nesdev.com/bbs/viewtopic.php?t=383

First off, http://nesdev.com/bbs/viewtopic.php?p=2622#2622 does not help me at all. But I think I might have figured out what the concept means, and how utterly confusingly every presentation has been (as well as the name).

Could a slot be a means of filling several areas of memory in an interleved fashion, a way of keeping several "current position" markers for each area? If so, calling them segments would have made their use obvious (I think this is what ca-65 calls them).

For example on the NES I'd have a segment for zero-page, one for low-memory, and one for each ROM bank. Then I'd fill them in an interleved fashion:

Code: Select all

    $0-$ff      zero_page
    $200-$7ff   low_mem
    $8000-$bfff rom_bank_0
    ...
    
    .segment "zero_page"
fast_temp:
    .byte   0   ; address = 0

    .segment "rom_bank_0"
    lda #12     ; address = $8000
    ; .. some routine here
    
    .segment "low_mem"
temp_buffer:
    .byte 0,0   ; address = $200
    
    .segment "zero_page"
another_variable:
    .byte   0   ; address = 1
    
    ; etc.

Posted: Mon Jul 04, 2005 3:58 am
by Bregalad
I can't get what you don't understand. A memory slot is just used because the assembler have to know at wich adress your variable or your code have to be stocked.

Posted: Sun Jul 10, 2005 2:40 pm
by Guest
A slot is a subdivision of the logical memory space.
A bank is a chunk of physical memory which is mapped to physical memory in a slot.

You typically have many banks which you swap in and out of various slots, so you can have much more physical memory than the CPU would normally allow.

You might also define slots in the assembler that don't strictly exist (the memory manager doesn't know about them), but are convenient for programming. E.g. in this example courtesy of Bregalad:

Code: Select all

.memorymap 
defaultslot 0 
slotsize $100 
slot 0 $0 ;0 page RAM 
..............
The CNROM MM doesn't actually have a slot for the zero page, but it's convenient to have in case you define too many variables.