SampleEmbeddedProject_NP

SampleEmbeddedProject_NP - TITLE Sample Embedded Project...

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

View Full Document Right Arrow Icon
Sheet1 Page 1 TITLE Sample Embedded Project (CmpE102)(SampleProject102.asm) ONE_BEQU01h ZERO_BEQU00h ONE_WEQU0001h ZERO_WEQU0000h XFR_COUNT EQU256 PIT_0_PORTEQU20h PIT_1_PORTEQU22h PIT_2_PORTEQU24h PIT_CTL_PORTEQU26h CTR_0_CTLEQU34h CTR_1_CTLEQU70h CTR_0_MSBEQU03h CTR_0_LSBEQU0E8h CTR_1_MSBEQU13h CTR_1_LSBEQU88h PIC_0_PORTEQU28h PIC_1_PORTEQU2Ah PIC_ICW1EQU1Bh PIC_ICW2EQU20h PIC_ICW4EQU01h PIC_OCW2EQU20h
Background image of page 1

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

View Full DocumentRight Arrow Icon
Sheet1 Page 2 ADC_PORTEQU30h DSPLY_PORTEQU38h .MODEL small .data ORG 0000h TYPE_0_IPWORD? TYPE_0_CSWORD? TYPE_1_IPWORD? TYPE_1_CSWORD? TYPE_2_IPWORD? TYPE_2_CSWORD? TYPE_3_IPWORD? TYPE_3_CSWORD? TYPE_4_IPWORD? TYPE_4_CSWORD? ORG 32*4 TYPE_20_IPWORD? TYPE_20_CSWORD? TYPE_21_IPWORD? TYPE_21_CSWORD? ORG 400h NEW_DATABYTE? OLD_DATABYTE? DSPLY_HEXBYTE? DSPLY_BCDBYTE? CC_FLAGBYTE? TYPE_0_CTRWORD? TYPE_1_CTRWORD? TYPE_2_CTRWORD? TYPE_3_CTRWORD? TYPE_4_CTRWORD? TYPE_20_CTRWORD? TYPE_21_CTRWORD? byteSize = ($ - NEW_DATA) - 1 ORG 500h
Background image of page 2
Sheet1 Page 3 H2BTBL_RAMBYTE256 DUP(?) .STACK 128 .code assume ds:_data mainPROC .STARTUP cli xorax, ax movds, ax moves, ax movss, ax callINIT_IVT callINIT_8259 callBLNK_DSPLY callINIT_8254 callXFR_TABLE movcx, byteSize movbx, OFFSET NEW_DATA Z_LUP: movBYTE PTR [bx], ZERO_B incbx loopZ_LUP sti
Background image of page 3

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

View Full DocumentRight Arrow Icon
Sheet1 Page 4 waitf:cmpCC_FLAG, ONE_B jnewaitf j callAVERAGE_DATA c moval, OLD_DATA m cmpal, DSPLY_HEX jeover j movDSPLY_HEX, al m callHEX2BCD c moval, DSPLY_BCD outDSPLY_PORT, al o over:movCC_FLAG, ZERO_B o jmpwaitf main ENDP
Background image of page 4
Sheet1 Page 5 INIT_IVT PROC NEAR movax, OFFSET DIV_ERR_ISR movTYPE_0_IP, ax movax, OFFSET SNGL_STEP_ISR movTYPE_1_IP, ax movax, OFFSET NMI_ISR movTYPE_2_IP, ax movax, OFFSET INTR_3_ISR movTYPE_3_IP, ax movax, OFFSET OVFL_ISR movTYPE_4_IP, ax movax, OFFSET SEC_ISR movTYPE_20_IP, ax movax, OFFSET ADC_CC_ISR movTYPE_21_IP, ax pushcs popax movTYPE_0_CS, ax movTYPE_1_CS, ax movTYPE_2_CS, ax movTYPE_3_CS, ax movTYPE_4_CS, ax movTYPE_20_CS, ax movTYPE_21_CS, ax ret INIT_IVTENDP INIT_8254PROC NEAR moval, CTR_0_CTL outPIT_CTL_PORT, al moval, CTR_1_CTL outPIT_CTL_PORT, al moval, CTR_0_LSB outPIT_0_PORT, al moval, CTR_0_MSB outPIT_0_PORT, al moval, CTR_1_LSB outPIT_1_PORT, al moval, CTR_1_MSB outPIT_1_PORT, al ret INIT_8254ENDP INIT_8259PROC NEAR moval, PIC_ICW1 outPIC_0_PORT, al moval, PIC_ICW2
Background image of page 5

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

View Full DocumentRight Arrow Icon
Page 6 outPIC_1_PORT, al moval, PIC_ICW4 outPIC_1_PORT, al ret INIT_8259ENDP BLNK_DSPLY PROC NEAR moval, 0FFh outDSPLY_PORT, al ret BLNK_DSPLY ENDP XFR_TABLE PROC NEAR movdi, OFFSET H2BTBL_RAM movsi, OFFSET H2BTBL movcx, XFR_COUNT agn:moval, cs:[si] mov[di], al incsi incdi loopagn ret XFR_TABLEENDP AVERAGE_DATAPROC NEAR xoral, al movah, al movdh, al movbx, OFFSET NEW_DATA moval, [bx] movdl, al incbx moval, [bx] addax, dx
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 09/08/2010 for the course CMPE 46 at San Jose State University .

Page1 / 18

SampleEmbeddedProject_NP - TITLE Sample Embedded Project...

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

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