lect19_C09

lect19_C09 - Define a program module NAME lect19 ORG DW...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
; Define a program module NAME lect19 ORG 0FFFEh ; set the RESET vector to go to main on start up DW main ; (more on this later but you need these 2 lines) // This program demonstrates how to create and initialize variables using // assembler directives and all the different address modes // ***NOTE: When running in the Simulator contents od data memory are not // properly initialized by assembler directives ***** ORG 0200h ; starting at memory address 200h (the beginning if RAM) // Declare a 16 bit scalar variable. In C: int scal = 0; scal DW 0 // Reserve space for a 16-bit number In C: int num; num DS16 1 n // declare and initialize an array of 16-bit integers called A // In C: unsigned int A = {0x0011, 0x4011, 0x2000, 0, 65000, 100}; A DW 0011h, 4011h, 2000h, 0h, 65000, 64000, 100 D // now reserve space for seven 16 bit words labeled B // In C: int B[7]; B DS16 7 B // declare an 8-bit variable called sz and assign it the value 7 sz DB 7 // In C: char sz=7; foo DS8 1 // reserve space for 1 byte labeled foo. In C: char foo;
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 2

lect19_C09 - Define a program module NAME lect19 ORG DW...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online