/*PARAMETER PASSING... Again, parameter passing with both functions (the assembly calls to the C and the C calls to the assembly) must adhere to the standard ICC11/ICC12 parameter passing rules: The output parameter, if it exists, is passed in Register D, The first input parameter is passed in Register D, The remaining input parameters are passed on the stack, 8-bit parameters are promoted to 16 bits. */ /* The .area pseudo-op specifies into which segment the subsequent code will be loaded. .area text ; code in the ROM segment .area data ; code in the initialized RAM segment .area idata ; code in ROM used to initialize the data segment .area bss ; code in the uninitialized RAM segment .text ; same as .area text .data ; same as .area data When writing assembly language programs, I suggest allocating variables in the .area bss segment and fixed constants/programs in the .area text. In other words, I suggest that you not use .area data and .area idata in your assembly programs. Other names can be used for segments. If the (abs) follows the name, the segment is considered absolute and can contain .org pseudo-ops. For example to set the reset vector in an assembly file, you could write .area VectorSegment(abs) .org 0xFFFE ; reset vector address .word Start ; place to begin The next set of directives allocate space in memory. The .blkb pseudo-op will set aside a fixed number of 8-bit bytes without initialization. Similarly, the .blkw pseudo-op will set aside a fixed number of 16-bit words without initialization. .blkb 10 ; reserve 10 bytes .blkw 20 ; reserve 20 words The next three directives load specific data into memory. The .byte pseudo-op will set aside a fixed number of 8-bit bytes and initialize the memory with the list of 8-bit bytes. The size of the allocated storage is determined by the number of data values in the list. The .word and .ascii pseudo-ops work in a similar way for 16-bit words and ASCII strings. The .asciz pseudo-op is similar to .ascii except that an extra byte is allocated and set to null (0). Examples include: .byte 10 ; reserve 1 byte initialized to 10 .byte 1,2,3 ; reserve 3 bytes initialized to 1,2,3 .word 20 ; reserve 1 word initialized to 20 .word 10,200 ; reserve 2 words initialized to 10,200 .ascii "JWV" ; reserve 3 bytes initialized to "J" "W" "V" .asciz "JWV" ; reserve 4 bytes initialized to "J" "W" "V" 0 */