1
0
mirror of https://github.com/pConst/basic_verilog.git synced 2025-01-28 07:02:55 +08:00

1988 lines
70 KiB
Plaintext

/* Symbol Table */
// APR = CONSTANT: 43
// APR2 = CONSTANT: 55
// AUG = CONSTANT: 47
// AUG2 = CONSTANT: 59
// B2BCD = LABEL: 466
// BCD_LP = LABEL: 467
// BIT0 = CONSTANT: 1
// BIT1 = CONSTANT: 2
// BIT2 = CONSTANT: 4
// BIT3 = CONSTANT: 8
// BIT4 = CONSTANT: 16
// BIT5 = CONSTANT: 32
// BIT6 = CONSTANT: 64
// BIT7 = CONSTANT: 128
// BLINK1 = LABEL: 75
// BLINK10 = LABEL: 73
// BLINK2 = LABEL: 106
// BLINK20 = LABEL: 104
// BTN_east = CONSTANT: 16
// BTN_north = CONSTANT: 64
// BTN_south = CONSTANT: 32
// BTN_west = CONSTANT: 128
// CLR_INT1 = LABEL: 945
// CLR_INT2 = LABEL: 820
// CMP_2 = LABEL: 968
// CMP_3 = LABEL: 972
// CMP_4 = LABEL: 975
// DAY_P = LABEL: 1003
// DAY_UP = CONSTANT: 31
// DEC = CONSTANT: 51
// DEC2 = CONSTANT: 63
// DMAX = CONSTANT: 39
// DSP_DD = LABEL: 316
// DSP_HH = LABEL: 179
// DSP_MM = LABEL: 196
// DSP_MON = LABEL: 299
// DSP_SS = LABEL: 213
// DSP_YY = LABEL: 333
// FEB = CONSTANT: 41
// FEB2 = CONSTANT: 53
// FRI = LABEL: 274
// H_END = LABEL: 471
// ISR = LABEL: 797
// ISR_s0 = CONSTANT: 1
// ISR_s1 = CONSTANT: 18
// ISR_s2 = CONSTANT: 21
// ITS_RIGHT = LABEL: 884
// JAN = CONSTANT: 40
// JAN2 = CONSTANT: 52
// JUL = CONSTANT: 46
// JUL2 = CONSTANT: 58
// JUN = CONSTANT: 45
// JUN2 = CONSTANT: 57
// LCD_DB4 = CONSTANT: 16
// LCD_DB5 = CONSTANT: 32
// LCD_DB6 = CONSTANT: 64
// LCD_DB7 = CONSTANT: 128
// LCD_E = CONSTANT: 1
// LCD_RS = CONSTANT: 4
// LCD_RW = CONSTANT: 2
// LCD_clear = LABEL: 758
// LCD_cursor = LABEL: 787
// LCD_drive = CONSTANT: 8
// LCD_input_port = CONSTANT: 2
// LCD_output_port = CONSTANT: 64
// LCD_pulse_E = LABEL: 699
// LCD_read_DB4 = CONSTANT: 16
// LCD_read_DB5 = CONSTANT: 32
// LCD_read_DB6 = CONSTANT: 64
// LCD_read_DB7 = CONSTANT: 128
// LCD_read_spare0 = CONSTANT: 1
// LCD_read_spare1 = CONSTANT: 2
// LCD_read_spare2 = CONSTANT: 4
// LCD_read_spare3 = CONSTANT: 8
// LCD_reset = LABEL: 741
// LCD_write_data = LABEL: 724
// LCD_write_inst4 = LABEL: 705
// LCD_write_inst8 = LABEL: 709
// LED0 = CONSTANT: 1
// LED1 = CONSTANT: 2
// LED2 = CONSTANT: 4
// LED3 = CONSTANT: 8
// LED4 = CONSTANT: 16
// LED5 = CONSTANT: 32
// LED6 = CONSTANT: 64
// LED7 = CONSTANT: 128
// LED_pattern = CONSTANT: 2
// LED_port = CONSTANT: 128
// M7_END = LABEL: 413
// MAR = CONSTANT: 42
// MAR2 = CONSTANT: 54
// MAY = CONSTANT: 44
// MAY2 = CONSTANT: 56
// MOD7 = LABEL: 410
// MODE2N = LABEL: 839
// MODE2P = LABEL: 898
// MODE3N = LABEL: 848
// MODE3P = LABEL: 907
// MODE4N = LABEL: 857
// MODE4P = LABEL: 916
// MODE5N = LABEL: 866
// MODE5P = LABEL: 925
// MODE6N = LABEL: 875
// MODE6P = LABEL: 936
// MODE7N = LABEL: 883
// MODE7P = LABEL: 944
// MODEUPDATE = LABEL: 433
// MODE_2 = LABEL: 188
// MODE_3 = LABEL: 205
// MODE_4 = LABEL: 222
// MODE_5 = LABEL: 308
// MODE_6 = LABEL: 325
// MODE_END = LABEL: 350
// MON = LABEL: 234
// NOCHANGE = LABEL: 435
// NOV = CONSTANT: 50
// NOV2 = CONSTANT: 62
// NO_BD = LABEL: 463
// NO_DAY_UP = LABEL: 392
// NO_FEB = LABEL: 360
// NO_MON_UP = LABEL: 392
// NO_RUNNIAN = LABEL: 360
// NO_YEAR_UP = LABEL: 392
// OCT = CONSTANT: 49
// OCT2 = CONSTANT: 61
// PAUSE = LABEL: 138
// RN = LABEL: 403
// ROTARY_PRESS1 = LABEL: 291
// ROTARY_PRESS2 = LABEL: 291
// ROTA_CNT = CONSTANT: 20
// RRESTART = LABEL: 96
// SAT = LABEL: 284
// SAVE_DAYN = LABEL: 873
// SAVE_DAYP = LABEL: 934
// SAVE_HHN = LABEL: 837
// SAVE_HHP = LABEL: 896
// SAVE_MMN = LABEL: 846
// SAVE_MMP = LABEL: 905
// SAVE_MONN = LABEL: 864
// SAVE_MONP = LABEL: 923
// SAVE_SSN = LABEL: 855
// SAVE_SSP = LABEL: 914
// SAVE_YEARN = LABEL: 882
// SAVE_YEARP = LABEL: 943
// SAV_ms100 = LABEL: 1012
// SEP = CONSTANT: 48
// SEP2 = CONSTANT: 60
// SETUP = LABEL: 425
// SKIP1 = LABEL: 291
// SPACE2 = LABEL: 346
// SPACE3 = LABEL: 323
// SPACE4 = LABEL: 306
// SPACE5 = LABEL: 220
// SPACE6 = LABEL: 203
// SPACE7 = LABEL: 186
// T2_5m_INT = LABEL: 947
// TEST_BIT0 = LABEL: 291
// THU = LABEL: 264
// TUE = LABEL: 244
// UNDER = LABEL: 365
// WAIT = LABEL: 461
// WED = LABEL: 254
// blink_flag = CONSTANT: 25
// character_0 = CONSTANT: 48
// character_1 = CONSTANT: 49
// character_2 = CONSTANT: 50
// character_3 = CONSTANT: 51
// character_4 = CONSTANT: 52
// character_5 = CONSTANT: 53
// character_6 = CONSTANT: 54
// character_7 = CONSTANT: 55
// character_8 = CONSTANT: 56
// character_9 = CONSTANT: 57
// character_A = CONSTANT: 65
// character_B = CONSTANT: 66
// character_BS = CONSTANT: 8
// character_C = CONSTANT: 67
// character_CR = CONSTANT: 13
// character_D = CONSTANT: 68
// character_E = CONSTANT: 69
// character_F = CONSTANT: 70
// character_G = CONSTANT: 71
// character_H = CONSTANT: 72
// character_I = CONSTANT: 73
// character_J = CONSTANT: 74
// character_K = CONSTANT: 75
// character_L = CONSTANT: 76
// character_M = CONSTANT: 77
// character_N = CONSTANT: 78
// character_O = CONSTANT: 79
// character_P = CONSTANT: 80
// character_Q = CONSTANT: 81
// character_R = CONSTANT: 82
// character_S = CONSTANT: 83
// character_T = CONSTANT: 84
// character_U = CONSTANT: 85
// character_V = CONSTANT: 86
// character_W = CONSTANT: 87
// character_X = CONSTANT: 88
// character_Y = CONSTANT: 89
// character_Z = CONSTANT: 90
// character_a = CONSTANT: 97
// character_b = CONSTANT: 98
// character_c = CONSTANT: 99
// character_colon = CONSTANT: 58
// character_comma = CONSTANT: 44
// character_d = CONSTANT: 100
// character_divide = CONSTANT: 47
// character_dollar = CONSTANT: 36
// character_e = CONSTANT: 101
// character_equals = CONSTANT: 61
// character_exclaim = CONSTANT: 33
// character_f = CONSTANT: 102
// character_g = CONSTANT: 103
// character_greater_than = CONSTANT: 62
// character_h = CONSTANT: 104
// character_i = CONSTANT: 105
// character_j = CONSTANT: 106
// character_k = CONSTANT: 107
// character_l = CONSTANT: 108
// character_less_than = CONSTANT: 60
// character_m = CONSTANT: 109
// character_minus = CONSTANT: 45
// character_n = CONSTANT: 110
// character_o = CONSTANT: 111
// character_p = CONSTANT: 112
// character_plus = CONSTANT: 43
// character_q = CONSTANT: 113
// character_question = CONSTANT: 63
// character_r = CONSTANT: 114
// character_s = CONSTANT: 115
// character_semi_colon = CONSTANT: 59
// character_space = CONSTANT: 32
// character_stop = CONSTANT: 46
// character_t = CONSTANT: 116
// character_u = CONSTANT: 117
// character_v = CONSTANT: 118
// character_w = CONSTANT: 119
// character_x = CONSTANT: 120
// character_y = CONSTANT: 121
// character_z = CONSTANT: 122
// chk_sf = LABEL: 449
// dayB = CONSTANT: 38
// dayH = CONSTANT: 29
// dayL = CONSTANT: 30
// delay_1ms = LABEL: 684
// delay_1s = LABEL: 694
// delay_1us = LABEL: 675
// delay_1us_constant = CONSTANT: 11
// delay_20ms = LABEL: 689
// delay_40us = LABEL: 679
// disp_flag = CONSTANT: 24
// disp_flag2 = CONSTANT: 26
// disp_msg1 = LABEL: 473
// disp_msg2 = LABEL: 500
// disp_msg3 = LABEL: 531
// disp_msg4 = LABEL: 554
// disp_msg5 = LABEL: 583
// disp_msg6 = LABEL: 613
// disp_msg7 = LABEL: 642
// disp_space = LABEL: 672
// end_ISR = LABEL: 1017
// hourB = CONSTANT: 33
// hourH = CONSTANT: 10
// hourL = CONSTANT: 9
// loop = LABEL: 145
// minB = CONSTANT: 34
// minH = CONSTANT: 8
// minL = CONSTANT: 7
// mode = CONSTANT: 3
// mode_save = LABEL: 815
// monB = CONSTANT: 37
// monH = CONSTANT: 27
// monL = CONSTANT: 28
// ms1 = CONSTANT: 4
// ms100 = CONSTANT: 19
// ms2 = CONSTANT: 16
// ms500 = CONSTANT: 17
// msg7 = LABEL: 453
// no_press = LABEL: 817
// pressed = CONSTANT: 23
// real_time_end = LABEL: 1006
// reset = LABEL: 0
// restart = LABEL: 65
// rotary_left = CONSTANT: 1
// rotary_port = CONSTANT: 1
// rotary_press = CONSTANT: 2
// rotary_status = CONSTANT: 0
// s0 = REGISTER: 0
// s1 = REGISTER: 1
// s2 = REGISTER: 2
// s3 = REGISTER: 3
// s4 = REGISTER: 4
// s5 = REGISTER: 5
// s6 = REGISTER: 6
// s7 = REGISTER: 7
// s8 = REGISTER: 8
// s9 = REGISTER: 9
// sA = REGISTER: 10
// sB = REGISTER: 11
// sC = REGISTER: 12
// sD = REGISTER: 13
// sE = REGISTER: 14
// sF = REGISTER: 15
// secB = CONSTANT: 35
// secH = CONSTANT: 6
// secL = CONSTANT: 5
// set_line2 = LABEL: 793
// shift_delay_lsb = CONSTANT: 244
// shift_delay_msb = CONSTANT: 1
// store_ms2 = LABEL: 1014
// switch0 = CONSTANT: 1
// switch1 = CONSTANT: 2
// switch2 = CONSTANT: 4
// switch3 = CONSTANT: 8
// switch_port = CONSTANT: 0
// temp = CONSTANT: 22
// wait1 = LABEL: 84
// wait2 = LABEL: 115
// wait_1ms = LABEL: 685
// wait_1s = LABEL: 695
// wait_1us = LABEL: 676
// wait_20ms = LABEL: 690
// wait_40us = LABEL: 680
// week = CONSTANT: 11
// year1 = CONSTANT: 12
// year100 = CONSTANT: 32
// year2 = CONSTANT: 13
// year3 = CONSTANT: 14
// year4 = CONSTANT: 15
// yearB = CONSTANT: 36
/* Program Code */
// #1: CONSTANT(LED_port,128) ;8 simple LEDs
// #2: CONSTANT(LED0,1) ; LED 0 - bit0
// #3: CONSTANT(LED1,2) ; 1 - bit1
// #4: CONSTANT(LED2,4) ; 2 - bit2
// #5: CONSTANT(LED3,8) ; 3 - bit3
// #6: CONSTANT(LED4,16) ; 4 - bit4
// #7: CONSTANT(LED5,32) ; 5 - bit5
// #8: CONSTANT(LED6,64) ; 6 - bit6
// #9: CONSTANT(LED7,128) ; 7 - bit7
// #10: ;
// #11: CONSTANT(switch_port,0) ;Read switches and press buttons
// #12: CONSTANT(switch0,1) ; Switches SW0 - bit0
// #13: CONSTANT(switch1,2) ; SW1 - bit1
// #14: CONSTANT(switch2,4) ; SW2 - bit2
// #15: CONSTANT(switch3,8) ; SW3 - bit3
// #16: CONSTANT(BTN_east,16) ; Buttons East - bit4
// #17: CONSTANT(BTN_south,32) ; South - bit5
// #18: CONSTANT(BTN_north,64) ; North - bit6
// #19: CONSTANT(BTN_west,128) ; West - bit7
// #20: ;
// #21: CONSTANT(rotary_port,1) ;Read status of rotary encoder
// #22: CONSTANT(rotary_left,1) ; Direction of last move Left=1 Right=0 - bit0
// #23: CONSTANT(rotary_press,2) ; Centre press contact (active High) - bit1
// #24: ;
// #25: ;LCD interface ports
// #26: ;
// #27: ;The master enable signal is not used by the LCD display itself
// #28: ;but may be required to confirm that LCD communication is active.
// #29: ;This is required on the Spartan-3E Starter Kit if the StrataFLASH
// #30: ;is used because it shares the same data pins and conflicts must be avoided.
// #31: ;
// #32: CONSTANT(LCD_output_port,64) ;LCD character module output data and control
// #33: CONSTANT(LCD_E,1) ; active High Enable E - bit0
// #34: CONSTANT(LCD_RW,2) ; Read=1 Write=0 RW - bit1
// #35: CONSTANT(LCD_RS,4) ; Instruction=0 Data=1 RS - bit2
// #36: CONSTANT(LCD_drive,8) ; Master enable (active High) - bit3
// #37: CONSTANT(LCD_DB4,16) ; 4-bit Data DB4 - bit4
// #38: CONSTANT(LCD_DB5,32) ; interface Data DB5 - bit5
// #39: CONSTANT(LCD_DB6,64) ; Data DB6 - bit6
// #40: CONSTANT(LCD_DB7,128) ; Data DB7 - bit7
// #41: ;
// #42: CONSTANT(LCD_input_port,2) ;LCD character module input data
// #43: CONSTANT(LCD_read_spare0,1) ; Spare bits - bit0
// #44: CONSTANT(LCD_read_spare1,2) ; are zero - bit1
// #45: CONSTANT(LCD_read_spare2,4) ; - bit2
// #46: CONSTANT(LCD_read_spare3,8) ; - bit3
// #47: CONSTANT(LCD_read_DB4,16) ; 4-bit Data DB4 - bit4
// #48: CONSTANT(LCD_read_DB5,32) ; interface Data DB5 - bit5
// #49: CONSTANT(LCD_read_DB6,64) ; Data DB6 - bit6
// #50: CONSTANT(LCD_read_DB7,128) ; Data DB7 - bit7
// #51: CONSTANT(BIT7,128) ;
// #52: CONSTANT(BIT6,64) ;
// #53: CONSTANT(BIT5,32) ;
// #54: CONSTANT(BIT4,16) ;
// #55: CONSTANT(BIT3,8) ;
// #56: CONSTANT(BIT2,4) ;
// #57: CONSTANT(BIT1,2) ;
// #58: CONSTANT(BIT0,1) ;
// #59: ;
// #60: ;**************************************************************************************
// #61: ;Scratch Pad Memory Locations
// #62: ;**************************************************************************************
// #63: ;
// #64: CONSTANT(rotary_status,0) ;Status of rotary encoder
// #65: CONSTANT(ISR_s0,1) ;Preserve s0 contents during ISR
// #66: CONSTANT(LED_pattern,2) ;LED pattern used in rotation mode
// #67: ;
// #68: CONSTANT(mode,3) ;control mode 00=switch and button FF=rotary
// #69: CONSTANT(ms1,4)
// #70: CONSTANT(secL,5)
// #71: CONSTANT(secH,6)
// #72: CONSTANT(minL,7)
// #73: CONSTANT(minH,8)
// #74: CONSTANT(hourL,9)
// #75: CONSTANT(hourH,10)
// #76: CONSTANT(week,11)
// #77: CONSTANT(year1,12)
// #78: CONSTANT(year2,13)
// #79: CONSTANT(year3,14)
// #80: CONSTANT(year4,15)
// #81: CONSTANT(ms2,16)
// #82: CONSTANT(ms500,17)
// #83: CONSTANT(ISR_s1,18)
// #84: CONSTANT(ms100,19)
// #85: CONSTANT(ROTA_CNT,20)
// #86: CONSTANT(ISR_s2,21)
// #87: CONSTANT(temp,22)
// #88: CONSTANT(pressed,23)
// #89: CONSTANT(disp_flag,24)
// #90: CONSTANT(blink_flag,25)
// #91: CONSTANT(disp_flag2,26) ;;;;;no use
// #92: CONSTANT(monH,27)
// #93: CONSTANT(monL,28)
// #94: CONSTANT(dayH,29)
// #95: CONSTANT(dayL,30)
// #96: CONSTANT(DAY_UP,31)
// #97: CONSTANT(year100,32)
// #98: CONSTANT(hourB,33)
// #99: CONSTANT(minB,34)
// #100: CONSTANT(secB,35)
// #101: CONSTANT(yearB,36)
// #102: CONSTANT(monB,37)
// #103: CONSTANT(dayB,38)
// #104: CONSTANT(DMAX,39) ;
// #105: CONSTANT(JAN,40) ;
// #106: CONSTANT(FEB,41) ;
// #107: CONSTANT(MAR,42) ;
// #108: CONSTANT(APR,43) ;
// #109: CONSTANT(MAY,44) ;
// #110: CONSTANT(JUN,45) ;
// #111: CONSTANT(JUL,46) ;
// #112: CONSTANT(AUG,47) ;
// #113: CONSTANT(SEP,48) ;
// #114: CONSTANT(OCT,49) ;
// #115: CONSTANT(NOV,50) ;
// #116: CONSTANT(DEC,51) ;
// #117: CONSTANT(JAN2,52) ;
// #118: CONSTANT(FEB2,53) ;
// #119: CONSTANT(MAR2,54) ;
// #120: CONSTANT(APR2,55) ;
// #121: CONSTANT(MAY2,56) ;
// #122: CONSTANT(JUN2,57) ;
// #123: CONSTANT(JUL2,58) ;
// #124: CONSTANT(AUG2,59) ;
// #125: CONSTANT(SEP2,60) ;
// #126: CONSTANT(OCT2,61) ;
// #127: CONSTANT(NOV2,62) ;
// #128: CONSTANT(DEC2,63) ;
// #129: ;The main operation of the program uses 1ms delays to set the shift rate
// #130: ;of the LCD display. A 16-bit value determines how many milliseconds
// #131: ;there are between shifts
// #132: ;
// #133: ;Tests indicate that the fastest shift rate that the LCD display supports is
// #134: ;500ms. Faster than this and the display becomes less clear to read.
// #135: ;
// #136: CONSTANT(shift_delay_msb,1) ;delay is 500ms (01F4 hex)
// #137: CONSTANT(shift_delay_lsb,F4)
// #138: ;
// #139: ; delay_1us_constant = (clock_rate - 6)/4 Where 'clock_rate' is in MHz
// #140: ;
// #141: ;Example: For a 50MHz clock the constant value is (10-6)/4 = 11 (0B Hex).
// #142: ;For clock rates below 10MHz the value of 1 must be used and the operation will
// #143: ;become lower than intended.
// #144: ;
// #145: CONSTANT(delay_1us_constant,11)
// #146: ;ASCII table
// #147: ;
// #148: CONSTANT(character_a,97)
// #149: CONSTANT(character_b,98)
// #150: CONSTANT(character_c,99)
// #151: CONSTANT(character_d,100)
// #152: CONSTANT(character_e,101)
// #153: CONSTANT(character_f,102)
// #154: CONSTANT(character_g,103)
// #155: CONSTANT(character_h,104)
// #156: CONSTANT(character_i,105)
// #157: CONSTANT(character_j,106)
// #158: CONSTANT(character_k,107)
// #159: CONSTANT(character_l,108)
// #160: CONSTANT(character_m,109)
// #161: CONSTANT(character_n,110)
// #162: CONSTANT(character_o,111)
// #163: CONSTANT(character_p,112)
// #164: CONSTANT(character_q,113)
// #165: CONSTANT(character_r,114)
// #166: CONSTANT(character_s,115)
// #167: CONSTANT(character_t,116)
// #168: CONSTANT(character_u,117)
// #169: CONSTANT(character_v,118)
// #170: CONSTANT(character_w,119)
// #171: CONSTANT(character_x,120)
// #172: CONSTANT(character_y,121)
// #173: CONSTANT(character_z,122)
// #174: CONSTANT(character_A,65)
// #175: CONSTANT(character_B,66)
// #176: CONSTANT(character_C,67)
// #177: CONSTANT(character_D,68)
// #178: CONSTANT(character_E,69)
// #179: CONSTANT(character_F,70)
// #180: CONSTANT(character_G,71)
// #181: CONSTANT(character_H,72)
// #182: CONSTANT(character_I,73)
// #183: CONSTANT(character_J,74)
// #184: CONSTANT(character_K,75)
// #185: CONSTANT(character_L,76)
// #186: CONSTANT(character_M,77)
// #187: CONSTANT(character_N,78)
// #188: CONSTANT(character_O,79)
// #189: CONSTANT(character_P,80)
// #190: CONSTANT(character_Q,81)
// #191: CONSTANT(character_R,82)
// #192: CONSTANT(character_S,83)
// #193: CONSTANT(character_T,84)
// #194: CONSTANT(character_U,85)
// #195: CONSTANT(character_V,86)
// #196: CONSTANT(character_W,87)
// #197: CONSTANT(character_X,88)
// #198: CONSTANT(character_Y,89)
// #199: CONSTANT(character_Z,90)
// #200: CONSTANT(character_0,48)
// #201: CONSTANT(character_1,49)
// #202: CONSTANT(character_2,50)
// #203: CONSTANT(character_3,51)
// #204: CONSTANT(character_4,52)
// #205: CONSTANT(character_5,53)
// #206: CONSTANT(character_6,54)
// #207: CONSTANT(character_7,55)
// #208: CONSTANT(character_8,56)
// #209: CONSTANT(character_9,57)
// #210: CONSTANT(character_colon,58)
// #211: CONSTANT(character_stop,46)
// #212: CONSTANT(character_semi_colon,59)
// #213: CONSTANT(character_minus,45)
// #214: CONSTANT(character_divide,47) ;'/'
// #215: CONSTANT(character_plus,43)
// #216: CONSTANT(character_comma,44)
// #217: CONSTANT(character_less_than,60)
// #218: CONSTANT(character_greater_than,62)
// #219: CONSTANT(character_equals,61)
// #220: CONSTANT(character_space,32)
// #221: CONSTANT(character_CR,13) ;carriage return
// #222: CONSTANT(character_question,63) ;'?'
// #223: CONSTANT(character_dollar,36)
// #224: CONSTANT(character_exclaim,33) ;'!'
// #225: CONSTANT(character_BS,8) ;Back Space command character
// #226: ;
// @000 #227: [reset]
302e5 // @000 #227: CALL(LCD_reset)
3c001 // @001 #228: ENABLE(INTERRUPT)
00dff // @002 #229: LOAD(sD,FF)
00000 // @003 #230: LOAD(s0,0) ;
2e00a // @004 #231: STORE(s0,hourH)
2e007 // @005 #232: STORE(s0,minL)
2e008 // @006 #233: STORE(s0,minH)
2e006 // @007 #234: STORE(s0,secH)
2e005 // @008 #235: STORE(s0,secL)
2e00d // @009 #236: STORE(s0,year2)
2e00e // @00a #237: STORE(s0,year3)
2e01b // @00b #238: STORE(s0,monH)
2e022 // @00c #239: STORE(s0,minB) ;;;;;;;;;;
2e023 // @00d #240: STORE(s0,secB) ;;;;;;;;;;
00009 // @00e #241: LOAD(s0,9) ;
2e009 // @00f #242: STORE(s0,hourL)
2e021 // @010 #243: STORE(s0,hourB) ;;;;;;;;;
00002 // @011 #244: LOAD(s0,2) ;
2e00c // @012 #245: STORE(s0,year1)
2e01d // @013 #246: STORE(s0,dayH)
00006 // @014 #247: LOAD(s0,6) ;
2e01e // @015 #248: STORE(s0,dayL)
2e00f // @016 #249: STORE(s0,year4)
2e024 // @017 #250: STORE(s0,yearB) ;;;;;;;;;
00005 // @018 #251: LOAD(s0,5) ;
2e01c // @019 #252: STORE(s0,monL)
2e00b // @01a #253: STORE(s0,week)
2e025 // @01b #254: STORE(s0,monB) ;;;;;;;;;
0001a // @01c #255: LOAD(s0,26)
2e026 // @01d #256: STORE(s0,dayB) ;;;;;;;;;
0001f // @01e #257: LOAD(s0,31)
2e028 // @01f #258: STORE(s0,JAN) ;1
2e02a // @020 #259: STORE(s0,MAR) ;3
2e02c // @021 #260: STORE(s0,MAY) ;5
2e02e // @022 #261: STORE(s0,JUL) ;7
2e02f // @023 #262: STORE(s0,AUG) ;8
2e031 // @024 #263: STORE(s0,OCT) ;10
2e033 // @025 #264: STORE(s0,DEC) ;12
0001e // @026 #265: LOAD(s0,30)
2e02b // @027 #266: STORE(s0,APR) ;4
2e02d // @028 #267: STORE(s0,JUN) ;6
2e030 // @029 #268: STORE(s0,SEP) ;9
2e032 // @02a #269: STORE(s0,NOV) ;11
0001c // @02b #270: LOAD(s0,28)
2e029 // @02c #271: STORE(s0,FEB) ;2
00003 // @02d #272: LOAD(s0,3)
2e034 // @02e #273: STORE(s0,JAN2)
2e03d // @02f #274: STORE(s0,OCT2)
00006 // @030 #275: LOAD(s0,6)
2e035 // @031 #276: STORE(s0,FEB2)
2e036 // @032 #277: STORE(s0,MAR2)
2e03e // @033 #278: STORE(s0,NOV2)
00002 // @034 #279: LOAD(s0,2)
2e037 // @035 #280: STORE(s0,APR2)
2e03a // @036 #281: STORE(s0,JUL2)
00004 // @037 #282: LOAD(s0,4)
2e038 // @038 #283: STORE(s0,MAY2)
00000 // @039 #284: LOAD(s0,0)
2e039 // @03a #285: STORE(s0,JUN2)
00005 // @03b #286: LOAD(s0,5)
2e03b // @03c #287: STORE(s0,AUG2)
00001 // @03d #288: LOAD(s0,1)
2e03c // @03e #289: STORE(s0,SEP2)
2e03f // @03f #290: STORE(s0,DEC2)
00f00 // @040 #291: LOAD(sF,0) ;
// @041 #292: [restart]
00510 // @041 #293: LOAD(s5,16)
30313 // @042 #294: CALL(LCD_cursor)
301d9 // @043 #295: CALL(disp_msg1)
00520 // @044 #296: LOAD(s5,32)
30313 // @045 #297: CALL(LCD_cursor)
301f4 // @046 #298: CALL(disp_msg2)
00335 // @047 #299: LOAD(s3,53)
2e316 // @048 #300: STORE(s3,temp)
// @049 #301: [BLINK10]
00300 // @049 #301: LOAD(s3,0)
2e313 // @04a #302: STORE(s3,ms100)
// @04b #303: [BLINK1]
06313 // @04b #303: FETCH(s3,ms100)
14305 // @04c #304: COMPARE(s3,5)
3584b // @04d #305: JUMP(C,BLINK1)
0052f // @04e #306: LOAD(s5,47)
30313 // @04f #307: CALL(LCD_cursor)
06516 // @050 #308: FETCH(s5,temp)
302d4 // @051 #309: CALL(LCD_write_data)
00300 // @052 #310: LOAD(s3,0)
2e313 // @053 #311: STORE(s3,ms100)
// @054 #312: [wait1]
06313 // @054 #312: FETCH(s3,ms100)
14305 // @055 #313: COMPARE(s3,5)
35854 // @056 #314: JUMP(C,wait1)
0052f // @057 #315: LOAD(s5,47)
30313 // @058 #316: CALL(LCD_cursor)
00520 // @059 #317: LOAD(s5,32)
302d4 // @05a #318: CALL(LCD_write_data)
06516 // @05b #319: FETCH(s5,temp)
185ff // @05c #320: ADD(s5,FF)
2e516 // @05d #321: STORE(s5,temp)
1452f // @05e #322: COMPARE(s5,47)
35449 // @05f #323: JUMP(NZ,BLINK10)
// @060 #324: [RRESTART]
00510 // @060 #324: LOAD(s5,16)
30313 // @061 #325: CALL(LCD_cursor)
30213 // @062 #326: CALL(disp_msg3)
00520 // @063 #327: LOAD(s5,32)
30313 // @064 #328: CALL(LCD_cursor)
3022a // @065 #329: CALL(disp_msg4)
00335 // @066 #330: LOAD(s3,53)
2e316 // @067 #331: STORE(s3,temp)
// @068 #332: [BLINK20]
00300 // @068 #332: LOAD(s3,0)
2e313 // @069 #333: STORE(s3,ms100)
// @06a #334: [BLINK2]
06313 // @06a #334: FETCH(s3,ms100)
14305 // @06b #335: COMPARE(s3,5)
3586a // @06c #336: JUMP(C,BLINK2)
0052f // @06d #337: LOAD(s5,47)
30313 // @06e #338: CALL(LCD_cursor)
06516 // @06f #339: FETCH(s5,temp)
302d4 // @070 #340: CALL(LCD_write_data)
00300 // @071 #341: LOAD(s3,0)
2e313 // @072 #342: STORE(s3,ms100)
// @073 #343: [wait2]
06313 // @073 #343: FETCH(s3,ms100)
14305 // @074 #344: COMPARE(s3,5)
35873 // @075 #345: JUMP(C,wait2)
0052f // @076 #346: LOAD(s5,47)
30313 // @077 #347: CALL(LCD_cursor)
00520 // @078 #348: LOAD(s5,32)
302d4 // @079 #349: CALL(LCD_write_data)
06516 // @07a #350: FETCH(s5,temp)
185ff // @07b #351: ADD(s5,FF)
2e516 // @07c #352: STORE(s5,temp)
1452f // @07d #353: COMPARE(s5,47)
35468 // @07e #354: JUMP(NZ,BLINK20)
00000 // @07f #355: LOAD(s0,0)
2e002 // @080 #356: STORE(s0,LED_pattern)
2e003 // @081 #357: STORE(s0,mode)
2e019 // @082 #358: STORE(s0,blink_flag)
2e013 // @083 #359: STORE(s0,ms100)
00510 // @084 #360: LOAD(s5,16)
30313 // @085 #361: CALL(LCD_cursor)
30247 // @086 #362: CALL(disp_msg5)
00520 // @087 #363: LOAD(s5,32)
30313 // @088 #364: CALL(LCD_cursor)
30265 // @089 #365: CALL(disp_msg6)
// @08a #366: [PAUSE]
06013 // @08a #366: FETCH(s0,ms100)
14032 // @08b #367: COMPARE(s0,50)
3588a // @08c #368: JUMP(C,PAUSE)
302f6 // @08d #369: CALL(LCD_clear)
04000 // @08e #370: INPUT(s0,0)
2e01a // @08f #371: STORE(s0,disp_flag2)
2e013 // @090 #372: STORE(s0,ms100)
// @091 #373: [loop]
06021 // @091 #374: FETCH(s0,hourB)
301d2 // @092 #375: CALL(B2BCD)
2e009 // @093 #376: STORE(s0,hourL)
2e10a // @094 #377: STORE(s1,hourH)
06022 // @095 #378: FETCH(s0,minB)
301d2 // @096 #379: CALL(B2BCD)
2e007 // @097 #380: STORE(s0,minL)
2e108 // @098 #381: STORE(s1,minH)
06023 // @099 #382: FETCH(s0,secB)
301d2 // @09a #383: CALL(B2BCD)
2e005 // @09b #384: STORE(s0,secL)
2e106 // @09c #385: STORE(s1,secH)
06026 // @09d #386: FETCH(s0,dayB)
301d2 // @09e #387: CALL(B2BCD)
2e01e // @09f #388: STORE(s0,dayL)
2e11d // @0a0 #389: STORE(s1,dayH)
06025 // @0a1 #390: FETCH(s0,monB)
301d2 // @0a2 #391: CALL(B2BCD)
2e01c // @0a3 #392: STORE(s0,monL)
2e11b // @0a4 #393: STORE(s1,monH)
06024 // @0a5 #394: FETCH(s0,yearB)
301d2 // @0a6 #395: CALL(B2BCD)
2e00f // @0a7 #396: STORE(s0,year4)
2e10e // @0a8 #397: STORE(s1,year3)
0afff // @0a9 #398: AND(sF,FF)
35523 // @0aa #399: JUMP(NZ,SKIP1)
// #400: ;;;DISP HH
00511 // @0ab #401: LOAD(s5,17)
30313 // @0ac #402: CALL(LCD_cursor)
06303 // @0ad #403: FETCH(s3,mode)
14301 // @0ae #404: COMPARE(s3,1)
354b3 // @0af #405: JUMP(NZ,DSP_HH)
06311 // @0b0 #406: FETCH(s3,ms500)
12301 // @0b1 #407: TEST(s3,1)
354ba // @0b2 #408: JUMP(NZ,SPACE7)
// @0b3 #409: [DSP_HH]
0650a // @0b3 #409: FETCH(s5,hourH)
18530 // @0b4 #410: ADD(s5,48)
302d4 // @0b5 #411: CALL(LCD_write_data)
06509 // @0b6 #412: FETCH(s5,hourL)
18530 // @0b7 #413: ADD(s5,48)
302d4 // @0b8 #414: CALL(LCD_write_data)
340bc // @0b9 #415: JUMP(MODE_2)
// @0ba #416: [SPACE7]
302a0 // @0ba #416: CALL(disp_space)
302a0 // @0bb #417: CALL(disp_space)
// @0bc #418: [MODE_2]
// #419: ;;;DISP MM
00514 // @0bc #420: LOAD(s5,20)
30313 // @0bd #421: CALL(LCD_cursor)
06303 // @0be #422: FETCH(s3,mode)
14302 // @0bf #423: COMPARE(s3,2)
354c4 // @0c0 #424: JUMP(NZ,DSP_MM)
06311 // @0c1 #425: FETCH(s3,ms500)
12301 // @0c2 #426: TEST(s3,1)
354cb // @0c3 #427: JUMP(NZ,SPACE6)
// @0c4 #428: [DSP_MM]
06508 // @0c4 #428: FETCH(s5,minH)
18530 // @0c5 #429: ADD(s5,48)
302d4 // @0c6 #430: CALL(LCD_write_data)
06507 // @0c7 #431: FETCH(s5,minL)
18530 // @0c8 #432: ADD(s5,48)
302d4 // @0c9 #433: CALL(LCD_write_data)
340cd // @0ca #434: JUMP(MODE_3)
// @0cb #435: [SPACE6]
302a0 // @0cb #435: CALL(disp_space)
302a0 // @0cc #436: CALL(disp_space)
// @0cd #437: [MODE_3]
// #438: ;;;DISP SS
00517 // @0cd #439: LOAD(s5,23)
30313 // @0ce #440: CALL(LCD_cursor)
06303 // @0cf #441: FETCH(s3,mode)
14303 // @0d0 #442: COMPARE(s3,3)
354d5 // @0d1 #443: JUMP(NZ,DSP_SS)
06311 // @0d2 #444: FETCH(s3,ms500)
12301 // @0d3 #445: TEST(s3,1)
354dc // @0d4 #446: JUMP(NZ,SPACE5)
// @0d5 #447: [DSP_SS]
06506 // @0d5 #447: FETCH(s5,secH)
18530 // @0d6 #448: ADD(s5,48)
302d4 // @0d7 #449: CALL(LCD_write_data)
06505 // @0d8 #450: FETCH(s5,secL)
18530 // @0d9 #451: ADD(s5,48)
302d4 // @0da #452: CALL(LCD_write_data)
340de // @0db #453: JUMP(MODE_4)
// @0dc #454: [SPACE5]
302a0 // @0dc #454: CALL(disp_space)
302a0 // @0dd #455: CALL(disp_space)
// @0de #456: [MODE_4]
// #457: ;;;DISP week
0051c // @0de #458: LOAD(s5,28)
30313 // @0df #459: CALL(LCD_cursor)
0630b // @0e0 #460: FETCH(s3,week)
14300 // @0e1 #461: COMPARE(s3,0)
354ea // @0e2 #462: JUMP(NZ,MON)
00553 // @0e3 #463: LOAD(s5,character_S)
302d4 // @0e4 #464: CALL(LCD_write_data)
00575 // @0e5 #465: LOAD(s5,character_u)
302d4 // @0e6 #466: CALL(LCD_write_data)
0056e // @0e7 #467: LOAD(s5,character_n)
302d4 // @0e8 #468: CALL(LCD_write_data)
34123 // @0e9 #469: JUMP(TEST_BIT0)
// @0ea #470: [MON]
0630b // @0ea #470: FETCH(s3,week)
14301 // @0eb #471: COMPARE(s3,1)
354f4 // @0ec #472: JUMP(NZ,TUE)
0054d // @0ed #473: LOAD(s5,character_M)
302d4 // @0ee #474: CALL(LCD_write_data)
0056f // @0ef #475: LOAD(s5,character_o)
302d4 // @0f0 #476: CALL(LCD_write_data)
0056e // @0f1 #477: LOAD(s5,character_n)
302d4 // @0f2 #478: CALL(LCD_write_data)
34123 // @0f3 #479: JUMP(TEST_BIT0)
// @0f4 #480: [TUE]
0630b // @0f4 #480: FETCH(s3,week)
14302 // @0f5 #481: COMPARE(s3,2)
354fe // @0f6 #482: JUMP(NZ,WED)
00554 // @0f7 #483: LOAD(s5,character_T)
302d4 // @0f8 #484: CALL(LCD_write_data)
00575 // @0f9 #485: LOAD(s5,character_u)
302d4 // @0fa #486: CALL(LCD_write_data)
00565 // @0fb #487: LOAD(s5,character_e)
302d4 // @0fc #488: CALL(LCD_write_data)
34123 // @0fd #489: JUMP(TEST_BIT0)
// @0fe #490: [WED]
0630b // @0fe #490: FETCH(s3,week)
14303 // @0ff #491: COMPARE(s3,3)
35508 // @100 #492: JUMP(NZ,THU)
00557 // @101 #493: LOAD(s5,character_W)
302d4 // @102 #494: CALL(LCD_write_data)
00565 // @103 #495: LOAD(s5,character_e)
302d4 // @104 #496: CALL(LCD_write_data)
00564 // @105 #497: LOAD(s5,character_d)
302d4 // @106 #498: CALL(LCD_write_data)
34123 // @107 #499: JUMP(TEST_BIT0)
// @108 #500: [THU]
0630b // @108 #500: FETCH(s3,week)
14304 // @109 #501: COMPARE(s3,4)
35512 // @10a #502: JUMP(NZ,FRI)
00554 // @10b #503: LOAD(s5,character_T)
302d4 // @10c #504: CALL(LCD_write_data)
00568 // @10d #505: LOAD(s5,character_h)
302d4 // @10e #506: CALL(LCD_write_data)
00575 // @10f #507: LOAD(s5,character_u)
302d4 // @110 #508: CALL(LCD_write_data)
34123 // @111 #509: JUMP(TEST_BIT0)
// @112 #510: [FRI]
0630b // @112 #510: FETCH(s3,week)
14305 // @113 #511: COMPARE(s3,5)
3551c // @114 #512: JUMP(NZ,SAT)
00546 // @115 #513: LOAD(s5,character_F)
302d4 // @116 #514: CALL(LCD_write_data)
00572 // @117 #515: LOAD(s5,character_r)
302d4 // @118 #516: CALL(LCD_write_data)
00569 // @119 #517: LOAD(s5,character_i)
302d4 // @11a #518: CALL(LCD_write_data)
34123 // @11b #519: JUMP(TEST_BIT0)
// @11c #520: [SAT]
00553 // @11c #520: LOAD(s5,character_S)
302d4 // @11d #521: CALL(LCD_write_data)
00561 // @11e #522: LOAD(s5,character_a)
302d4 // @11f #523: CALL(LCD_write_data)
00574 // @120 #524: LOAD(s5,character_t)
302d4 // @121 #525: CALL(LCD_write_data)
34123 // @122 #526: JUMP(TEST_BIT0)
// @123 #527: [TEST_BIT0]
// @123 #528: [ROTARY_PRESS1]
// @123 #529: [ROTARY_PRESS2]
// @123 #530: [SKIP1]
// #531: ;;;DISP month
00526 // @123 #532: LOAD(s5,38)
30313 // @124 #533: CALL(LCD_cursor)
06303 // @125 #534: FETCH(s3,mode)
14304 // @126 #535: COMPARE(s3,4)
3552b // @127 #536: JUMP(NZ,DSP_MON)
06311 // @128 #537: FETCH(s3,ms500)
12301 // @129 #538: TEST(s3,1)
35532 // @12a #539: JUMP(NZ,SPACE4)
// @12b #540: [DSP_MON]
0651b // @12b #540: FETCH(s5,monH)
18530 // @12c #541: ADD(s5,48)
302d4 // @12d #542: CALL(LCD_write_data)
0651c // @12e #543: FETCH(s5,monL)
18530 // @12f #544: ADD(s5,48)
302d4 // @130 #545: CALL(LCD_write_data)
34134 // @131 #546: JUMP(MODE_5)
// @132 #547: [SPACE4]
302a0 // @132 #547: CALL(disp_space)
302a0 // @133 #548: CALL(disp_space)
// @134 #549: [MODE_5]
// #550: ;;;DISP day
00529 // @134 #551: LOAD(s5,41)
30313 // @135 #552: CALL(LCD_cursor)
06303 // @136 #553: FETCH(s3,mode)
14305 // @137 #554: COMPARE(s3,5)
3553c // @138 #555: JUMP(NZ,DSP_DD)
06311 // @139 #556: FETCH(s3,ms500)
12301 // @13a #557: TEST(s3,1)
35543 // @13b #558: JUMP(NZ,SPACE3)
// @13c #559: [DSP_DD]
0651d // @13c #559: FETCH(s5,dayH)
18530 // @13d #560: ADD(s5,48)
302d4 // @13e #561: CALL(LCD_write_data)
0651e // @13f #562: FETCH(s5,dayL)
18530 // @140 #563: ADD(s5,48)
302d4 // @141 #564: CALL(LCD_write_data)
34145 // @142 #565: JUMP(MODE_6)
// @143 #566: [SPACE3]
302a0 // @143 #566: CALL(disp_space)
302a0 // @144 #567: CALL(disp_space)
// @145 #568: [MODE_6]
// #569: ;;;DISP year
0052c // @145 #570: LOAD(s5,44)
30313 // @146 #571: CALL(LCD_cursor)
06303 // @147 #572: FETCH(s3,mode)
14306 // @148 #573: COMPARE(s3,6)
3554d // @149 #574: JUMP(NZ,DSP_YY)
06311 // @14a #575: FETCH(s3,ms500)
12301 // @14b #576: TEST(s3,1)
3555a // @14c #577: JUMP(NZ,SPACE2)
// @14d #578: [DSP_YY]
0650c // @14d #578: FETCH(s5,year1)
18530 // @14e #579: ADD(s5,48)
302d4 // @14f #580: CALL(LCD_write_data)
0650d // @150 #581: FETCH(s5,year2)
18530 // @151 #582: ADD(s5,48)
302d4 // @152 #583: CALL(LCD_write_data)
0650e // @153 #584: FETCH(s5,year3)
18530 // @154 #585: ADD(s5,48)
302d4 // @155 #586: CALL(LCD_write_data)
0650f // @156 #587: FETCH(s5,year4)
18530 // @157 #588: ADD(s5,48)
302d4 // @158 #589: CALL(LCD_write_data)
3415e // @159 #590: JUMP(MODE_END)
// @15a #591: [SPACE2]
302a0 // @15a #591: CALL(disp_space)
302a0 // @15b #592: CALL(disp_space)
302a0 // @15c #593: CALL(disp_space)
302a0 // @15d #594: CALL(disp_space)
// @15e #595: [MODE_END]
06025 // @15e #596: FETCH(s0,monB)
00127 // @15f #597: LOAD(s1,DMAX)
19100 // @160 #598: ADD(s1,s0)
07210 // @161 #599: FETCH(s2,s1) ;;28
14002 // @162 #600: COMPARE(s0,2) ;;Y
35568 // @163 #601: JUMP(NZ,NO_FEB)
06124 // @164 #602: FETCH(s1,yearB)
0a103 // @165 #603: AND(s1,3)
35568 // @166 #604: JUMP(NZ,NO_FEB)
18201 // @167 #605: ADD(s2,1)
// @168 #606: [NO_RUNNIAN]
// @168 #607: [NO_FEB]
2e227 // @168 #607: STORE(s2,DMAX)
06126 // @169 #608: FETCH(s1,dayB)
15210 // @16a #609: COMPARE(s2,s1)
35d6d // @16b #610: JUMP(NC,UNDER)
2e226 // @16c #611: STORE(s2,dayB)
// @16d #612: [UNDER]
0611f // @16d #613: FETCH(s1,DAY_UP)
0b110 // @16e #614: AND(s1,s1)
35188 // @16f #615: JUMP(Z,NO_DAY_UP)
06126 // @170 #616: FETCH(s1,dayB)
18101 // @171 #617: ADD(s1,1)
2e126 // @172 #618: STORE(s1,dayB)
06227 // @173 #619: FETCH(s2,DMAX)
18201 // @174 #620: ADD(s2,1)
15120 // @175 #621: COMPARE(s1,s2)
35588 // @176 #622: JUMP(NZ,NO_MON_UP)
00101 // @177 #623: LOAD(s1,1)
2e126 // @178 #624: STORE(s1,dayB)
06125 // @179 #625: FETCH(s1,monB)
18101 // @17a #626: ADD(s1,1)
2e125 // @17b #627: STORE(s1,monB)
1410d // @17c #628: COMPARE(s1,13)
35588 // @17d #629: JUMP(NZ,NO_YEAR_UP)
00101 // @17e #630: LOAD(s1,1)
2e125 // @17f #631: STORE(s1,monB)
06124 // @180 #632: FETCH(s1,yearB)
18101 // @181 #633: ADD(s1,1)
2e124 // @182 #634: STORE(s1,yearB)
14164 // @183 #635: COMPARE(s1,100)
35588 // @184 #636: JUMP(NZ,NO_YEAR_UP)
00100 // @185 #637: LOAD(s1,0)
2e124 // @186 #638: STORE(s1,yearB)
34188 // @187 #639: JUMP(NO_YEAR_UP)
// @188 #640: [NO_MON_UP]
// @188 #641: [NO_DAY_UP]
// @188 #642: [NO_YEAR_UP]
00000 // @188 #643: LOAD(s0,0)
2e01f // @189 #644: STORE(s0,DAY_UP)
00033 // @18a #645: LOAD(s0,DEC)
06225 // @18b #646: FETCH(s2,monB)
19020 // @18c #647: ADD(s0,s2)
07100 // @18d #648: FETCH(s1,s0) ;;;K
06024 // @18e #649: FETCH(s0,yearB)
19100 // @18f #650: ADD(s1,s0) ;;;;;;;K+Y
14203 // @190 #651: COMPARE(s2,3)
35993 // @191 #652: JUMP(C,RN)
18001 // @192 #653: ADD(s0,1) ;;;;100+Y >2(3..12)
// @193 #654: [RN]
18063 // @193 #654: ADD(s0,99) ;;;;;99+Y 1,2
2000e // @194 #655: SR0(s0)
2000e // @195 #656: SR0(s0) ;;;/4
19010 // @196 #657: ADD(s0,s1)
18006 // @197 #658: ADD(s0,6)
06226 // @198 #659: FETCH(s2,dayB)
19020 // @199 #660: ADD(s0,s2)
// @19a #661: [MOD7]
180f9 // @19a #661: ADD(s0,F9)
35d9d // @19b #662: JUMP(NC,M7_END)
3419a // @19c #663: JUMP(MOD7)
// @19d #664: [M7_END]
18007 // @19d #664: ADD(s0,7)
2e00b // @19e #665: STORE(s0,week)
06003 // @19f #666: FETCH(s0,mode)
0a0ff // @1a0 #667: AND(s0,FF)
355a9 // @1a1 #668: JUMP(NZ,SETUP)
// #669: ;;;RUN
00520 // @1a2 #670: LOAD(s5,32)
30313 // @1a3 #671: CALL(LCD_cursor)
06518 // @1a4 #672: FETCH(s5,disp_flag)
302d4 // @1a5 #673: CALL(LCD_write_data)
302d4 // @1a6 #674: CALL(LCD_write_data)
302d4 // @1a7 #675: CALL(LCD_write_data)
341b1 // @1a8 #676: JUMP(MODEUPDATE)
// @1a9 #677: [SETUP]
// #678: ;;;SET
00520 // @1a9 #679: LOAD(s5,32)
30313 // @1aa #680: CALL(LCD_cursor)
00553 // @1ab #681: LOAD(s5,83) ;;;;;;;;;;;;;;;;;;;;;;; S
302d4 // @1ac #682: CALL(LCD_write_data)
00545 // @1ad #683: LOAD(s5,69) ;;;;;;;;;;;;;;;;;;;;;;; E
302d4 // @1ae #684: CALL(LCD_write_data)
00554 // @1af #685: LOAD(s5,84) ;;;;;;;;;;;;;;;;;;;;;;; T
302d4 // @1b0 #686: CALL(LCD_write_data)
// @1b1 #687: [MODEUPDATE]
06003 // @1b1 #687: FETCH(s0,mode)
2e019 // @1b2 #688: STORE(s0,blink_flag)
// @1b3 #689: [NOCHANGE]
04000 // @1b3 #690: INPUT(s0,0)
0611a // @1b4 #691: FETCH(s1,disp_flag2)
0f100 // @1b5 #692: XOR(s1,s0)
35441 // @1b6 #693: JUMP(NZ,restart)
2e01a // @1b7 #694: STORE(s0,disp_flag2)
06025 // @1b8 #695: FETCH(s0,monB)
14005 // @1b9 #696: COMPARE(s0,5)
355c1 // @1ba #697: JUMP(NZ,chk_sf)
06026 // @1bb #698: FETCH(s0,dayB)
14011 // @1bc #699: COMPARE(s0,17)
355c1 // @1bd #700: JUMP(NZ,chk_sf)
06022 // @1be #701: FETCH(s0,minB)
14000 // @1bf #702: COMPARE(s0,0)
351c5 // @1c0 #703: JUMP(Z,msg7)
// @1c1 #704: [chk_sf]
14fff // @1c1 #704: COMPARE(sF,FF)
355cf // @1c2 #705: JUMP(NZ,NO_BD)
302e5 // @1c3 #706: CALL(LCD_reset)
341cf // @1c4 #707: JUMP(NO_BD)
// @1c5 #708: [msg7]
00510 // @1c5 #708: LOAD(s5,16)
30313 // @1c6 #709: CALL(LCD_cursor)
30282 // @1c7 #710: CALL(disp_msg7) ;
06013 // @1c8 #711: FETCH(s0,ms100)
14032 // @1c9 #712: COMPARE(s0,50)
359cd // @1ca #713: JUMP(C,WAIT)
00f00 // @1cb #714: LOAD(sF,0)
34041 // @1cc #715: JUMP(restart)
// @1cd #716: [WAIT]
00fff // @1cd #716: LOAD(sF,FF)
34091 // @1ce #717: JUMP(loop)
// @1cf #718: [NO_BD]
00f00 // @1cf #718: LOAD(sF,0)
2ef13 // @1d0 #719: STORE(sF,ms100)
34091 // @1d1 #720: JUMP(loop)
// #721: ;;;;;;;;;s0---BINARY, s1---BCD_H, s0---BCD_L
// @1d2 #722: [B2BCD]
00100 // @1d2 #722: LOAD(s1,0) ;
// @1d3 #723: [BCD_LP]
180f6 // @1d3 #723: ADD(s0,F6)
35dd7 // @1d4 #724: JUMP(NC,H_END)
18101 // @1d5 #725: ADD(s1,1) ;
341d3 // @1d6 #726: JUMP(BCD_LP)
// @1d7 #727: [H_END]
1800a // @1d7 #727: ADD(s0,10)
2a000 // @1d8 #728: RETURN
// #729: ;
// #730: ; normal_mode: INPUT s0, switch_port ;Read switches and buttons and directly drive LEDs
// #731: ; OUTPUT s0, LED_port
// #732: ; RETURN
// #733: ;
// #734: ;
// #735: ;
// #736: ;This procedure will poll the status of the rotary encoder.
// #737: ;If rotation occurs, then the LED pattern will adjust appropriately.
// #738: ;
// #739: ; rotate_mode: FETCH sA, LED_pattern ;last known position
// #740: ; FETCH s0, rotary_status ;check status of rotation
// #741: ; TEST s0, 80 ;test flag
// #742: ; JUMP Z, update_pattern
// #743: ; AND s0, 7F ;clear flag
// #744: ; STORE s0, rotary_status
// #745: ; TEST s0, rotary_left ;event occurred so update pattern
// #746: ; JUMP Z, move_right
// #747: ; RL sA
// #748: ; JUMP update_pattern
// #749: ; move_right: RR sA
// #750: ; update_pattern: STORE sA, LED_pattern
// #751: ; OUTPUT sA, LED_port ;drive LEDs with current pattern
// #752: ; RETURN
// #753: ; ;
// #754: ;
// #755: ;
// #756: ;
// #757: ;**************************************************************************************
// #758: ;LCD text messages
// #759: ;**************************************************************************************
// #760: ;
// #761: ;
// #762: ;Display 'SPARTAN-3E STARTER KIT' on LCD at current cursor position
// #763: ;
// #764: ;
// @1d9 #765: [disp_msg1]
302a0 // @1d9 #766: CALL(disp_space)
00541 // @1da #767: LOAD(s5,character_A)
302d4 // @1db #768: CALL(LCD_write_data)
302a0 // @1dc #769: CALL(disp_space)
00543 // @1dd #770: LOAD(s5,character_C)
302d4 // @1de #771: CALL(LCD_write_data)
0056c // @1df #772: LOAD(s5,character_l)
302d4 // @1e0 #773: CALL(LCD_write_data)
0056f // @1e1 #774: LOAD(s5,character_o)
302d4 // @1e2 #775: CALL(LCD_write_data)
00563 // @1e3 #776: LOAD(s5,character_c)
302d4 // @1e4 #777: CALL(LCD_write_data)
0056b // @1e5 #778: LOAD(s5,character_k)
302d4 // @1e6 #779: CALL(LCD_write_data)
302a0 // @1e7 #780: CALL(disp_space)
00542 // @1e8 #781: LOAD(s5,character_B)
302d4 // @1e9 #782: CALL(LCD_write_data)
00561 // @1ea #783: LOAD(s5,character_a)
302d4 // @1eb #784: CALL(LCD_write_data)
00573 // @1ec #785: LOAD(s5,character_s)
302d4 // @1ed #786: CALL(LCD_write_data)
00565 // @1ee #787: LOAD(s5,character_e)
302d4 // @1ef #788: CALL(LCD_write_data)
00564 // @1f0 #789: LOAD(s5,character_d)
302d4 // @1f1 #790: CALL(LCD_write_data)
302a0 // @1f2 #791: CALL(disp_space)
2a000 // @1f3 #792: RETURN
// #793: ;
// #794: ;
// #795: ;
// @1f4 #796: [disp_msg2]
00553 // @1f4 #796: LOAD(s5,character_S)
302d4 // @1f5 #797: CALL(LCD_write_data)
00533 // @1f6 #798: LOAD(s5,character_3)
302d4 // @1f7 #799: CALL(LCD_write_data)
00545 // @1f8 #800: LOAD(s5,character_E)
302d4 // @1f9 #801: CALL(LCD_write_data)
302a0 // @1fa #802: CALL(disp_space)
00553 // @1fb #803: LOAD(s5,character_S)
302d4 // @1fc #804: CALL(LCD_write_data)
00574 // @1fd #805: LOAD(s5,character_t)
302d4 // @1fe #806: CALL(LCD_write_data)
00561 // @1ff #807: LOAD(s5,character_a)
302d4 // @200 #808: CALL(LCD_write_data)
00572 // @201 #809: LOAD(s5,character_r)
302d4 // @202 #810: CALL(LCD_write_data)
00574 // @203 #811: LOAD(s5,character_t)
302d4 // @204 #812: CALL(LCD_write_data)
00565 // @205 #813: LOAD(s5,character_e)
302d4 // @206 #814: CALL(LCD_write_data)
00572 // @207 #815: LOAD(s5,character_r)
302d4 // @208 #816: CALL(LCD_write_data)
302a0 // @209 #817: CALL(disp_space)
0054b // @20a #818: LOAD(s5,character_K)
302d4 // @20b #819: CALL(LCD_write_data)
00569 // @20c #820: LOAD(s5,character_i)
302d4 // @20d #821: CALL(LCD_write_data)
00574 // @20e #822: LOAD(s5,character_t)
302d4 // @20f #823: CALL(LCD_write_data)
00533 // @210 #824: LOAD(s5,character_3)
302d4 // @211 #825: CALL(LCD_write_data)
2a000 // @212 #826: RETURN
// @213 #827: [disp_msg3]
302a0 // @213 #827: CALL(disp_space)
302a0 // @214 #828: CALL(disp_space)
302a0 // @215 #829: CALL(disp_space)
302a0 // @216 #830: CALL(disp_space)
302a0 // @217 #831: CALL(disp_space)
00558 // @218 #832: LOAD(s5,character_X)
302d4 // @219 #833: CALL(LCD_write_data)
00569 // @21a #834: LOAD(s5,character_i)
302d4 // @21b #835: CALL(LCD_write_data)
0056c // @21c #836: LOAD(s5,character_l)
302d4 // @21d #837: CALL(LCD_write_data)
00569 // @21e #838: LOAD(s5,character_i)
302d4 // @21f #839: CALL(LCD_write_data)
0056e // @220 #840: LOAD(s5,character_n)
302d4 // @221 #841: CALL(LCD_write_data)
00578 // @222 #842: LOAD(s5,character_x)
302d4 // @223 #843: CALL(LCD_write_data)
302a0 // @224 #844: CALL(disp_space)
302a0 // @225 #845: CALL(disp_space)
302a0 // @226 #846: CALL(disp_space)
302a0 // @227 #847: CALL(disp_space)
302a0 // @228 #848: CALL(disp_space)
2a000 // @229 #849: RETURN
// @22a #850: [disp_msg4]
00550 // @22a #850: LOAD(s5,character_P)
302d4 // @22b #851: CALL(LCD_write_data)
00569 // @22c #852: LOAD(s5,character_i)
302d4 // @22d #853: CALL(LCD_write_data)
00563 // @22e #854: LOAD(s5,character_c)
302d4 // @22f #855: CALL(LCD_write_data)
0056f // @230 #856: LOAD(s5,character_o)
302d4 // @231 #857: CALL(LCD_write_data)
00542 // @232 #858: LOAD(s5,character_B)
302d4 // @233 #859: CALL(LCD_write_data)
0056c // @234 #860: LOAD(s5,character_l)
302d4 // @235 #861: CALL(LCD_write_data)
00561 // @236 #862: LOAD(s5,character_a)
302d4 // @237 #863: CALL(LCD_write_data)
0057a // @238 #864: LOAD(s5,character_z)
302d4 // @239 #865: CALL(LCD_write_data)
00565 // @23a #866: LOAD(s5,character_e)
302d4 // @23b #867: CALL(LCD_write_data)
302a0 // @23c #868: CALL(disp_space)
00554 // @23d #869: LOAD(s5,character_T)
302d4 // @23e #870: CALL(LCD_write_data)
00565 // @23f #871: LOAD(s5,character_e)
302d4 // @240 #872: CALL(LCD_write_data)
00573 // @241 #873: LOAD(s5,character_s)
302d4 // @242 #874: CALL(LCD_write_data)
00574 // @243 #875: LOAD(s5,character_t)
302d4 // @244 #876: CALL(LCD_write_data)
302a0 // @245 #877: CALL(disp_space)
2a000 // @246 #878: RETURN
// @247 #879: [disp_msg5]
00550 // @247 #879: LOAD(s5,character_P)
302d4 // @248 #880: CALL(LCD_write_data)
00572 // @249 #881: LOAD(s5,character_r)
302d4 // @24a #882: CALL(LCD_write_data)
00565 // @24b #883: LOAD(s5,character_e)
302d4 // @24c #884: CALL(LCD_write_data)
00573 // @24d #885: LOAD(s5,character_s)
302d4 // @24e #886: CALL(LCD_write_data)
00573 // @24f #887: LOAD(s5,character_s)
302d4 // @250 #888: CALL(LCD_write_data)
302a0 // @251 #889: CALL(disp_space)
00526 // @252 #890: LOAD(s5,38)
302d4 // @253 #891: CALL(LCD_write_data)
302a0 // @254 #892: CALL(disp_space)
00554 // @255 #893: LOAD(s5,character_T)
302d4 // @256 #894: CALL(LCD_write_data)
00575 // @257 #895: LOAD(s5,character_u)
302d4 // @258 #896: CALL(LCD_write_data)
00572 // @259 #897: LOAD(s5,character_r)
302d4 // @25a #898: CALL(LCD_write_data)
0056e // @25b #899: LOAD(s5,character_n)
302d4 // @25c #900: CALL(LCD_write_data)
302a0 // @25d #901: CALL(disp_space)
00574 // @25e #902: LOAD(s5,character_t)
302d4 // @25f #903: CALL(LCD_write_data)
00568 // @260 #904: LOAD(s5,character_h)
302d4 // @261 #905: CALL(LCD_write_data)
00565 // @262 #906: LOAD(s5,character_e)
302d4 // @263 #907: CALL(LCD_write_data)
2a000 // @264 #908: RETURN
// @265 #909: [disp_msg6]
302a0 // @265 #909: CALL(disp_space)
00545 // @266 #910: LOAD(s5,character_E)
302d4 // @267 #911: CALL(LCD_write_data)
0056e // @268 #912: LOAD(s5,character_n)
302d4 // @269 #913: CALL(LCD_write_data)
00563 // @26a #914: LOAD(s5,character_c)
302d4 // @26b #915: CALL(LCD_write_data)
0056f // @26c #916: LOAD(s5,character_o)
302d4 // @26d #917: CALL(LCD_write_data)
00564 // @26e #918: LOAD(s5,character_d)
302d4 // @26f #919: CALL(LCD_write_data)
00565 // @270 #920: LOAD(s5,character_e)
302d4 // @271 #921: CALL(LCD_write_data)
00572 // @272 #922: LOAD(s5,character_r)
302d4 // @273 #923: CALL(LCD_write_data)
302a0 // @274 #924: CALL(disp_space)
00574 // @275 #925: LOAD(s5,character_t)
302d4 // @276 #926: CALL(LCD_write_data)
0056f // @277 #927: LOAD(s5,character_o)
302d4 // @278 #928: CALL(LCD_write_data)
302a0 // @279 #929: CALL(disp_space)
00553 // @27a #930: LOAD(s5,character_S)
302d4 // @27b #931: CALL(LCD_write_data)
00565 // @27c #932: LOAD(s5,character_e)
302d4 // @27d #933: CALL(LCD_write_data)
00574 // @27e #934: LOAD(s5,character_t)
302d4 // @27f #935: CALL(LCD_write_data)
302a0 // @280 #936: CALL(disp_space)
2a000 // @281 #937: RETURN
// @282 #938: [disp_msg7]
00548 // @282 #938: LOAD(s5,character_H)
302d4 // @283 #939: CALL(LCD_write_data)
00561 // @284 #940: LOAD(s5,character_a)
302d4 // @285 #941: CALL(LCD_write_data)
00570 // @286 #942: LOAD(s5,character_p)
302d4 // @287 #943: CALL(LCD_write_data)
00570 // @288 #944: LOAD(s5,character_p)
302d4 // @289 #945: CALL(LCD_write_data)
00579 // @28a #946: LOAD(s5,character_y)
302d4 // @28b #947: CALL(LCD_write_data)
302a0 // @28c #948: CALL(disp_space)
00542 // @28d #949: LOAD(s5,character_B)
302d4 // @28e #950: CALL(LCD_write_data)
00569 // @28f #951: LOAD(s5,character_i)
302d4 // @290 #952: CALL(LCD_write_data)
00572 // @291 #953: LOAD(s5,character_r)
302d4 // @292 #954: CALL(LCD_write_data)
00574 // @293 #955: LOAD(s5,character_t)
302d4 // @294 #956: CALL(LCD_write_data)
00568 // @295 #957: LOAD(s5,character_h)
302d4 // @296 #958: CALL(LCD_write_data)
00564 // @297 #959: LOAD(s5,character_d)
302d4 // @298 #960: CALL(LCD_write_data)
00561 // @299 #961: LOAD(s5,character_a)
302d4 // @29a #962: CALL(LCD_write_data)
00579 // @29b #963: LOAD(s5,character_y)
302d4 // @29c #964: CALL(LCD_write_data)
00521 // @29d #965: LOAD(s5,33)
302d4 // @29e #966: CALL(LCD_write_data)
2a000 // @29f #967: RETURN
// #968: ;
// #969: ;Display a space on LCD at current cursor position
// #970: ;
// #971: ;
// @2a0 #972: [disp_space]
00520 // @2a0 #972: LOAD(s5,character_space)
302d4 // @2a1 #973: CALL(LCD_write_data)
2a000 // @2a2 #974: RETURN
// #975: ;
// #976: ;
// #977: ;
// #978: ;
// #979: ;**************************************************************************************
// #980: ;Software delay routines
// #981: ;**************************************************************************************
// #982: ;
// #983: ;
// #984: ;
// #985: ;Delay of 1us.
// #986: ;
// #987: ;Constant value defines reflects the clock applied to KCPSM3. Every instruction
// #988: ;executes in 2 clock cycles making the calculation highly predictable. The '6' in
// #989: ;the following equation even allows for 'CALL delay_1us' instruction in the initiating code.
// #990: ;
// #991: ; delay_1us_constant = (clock_rate - 6)/4 Where 'clock_rate' is in MHz
// #992: ;
// #993: ;Registers used s0
// #994: ;
// @2a3 #995: [delay_1us]
0000b // @2a3 #995: LOAD(s0,delay_1us_constant)
// @2a4 #996: [wait_1us]
1c001 // @2a4 #996: SUB(s0,1)
356a4 // @2a5 #997: JUMP(NZ,wait_1us)
2a000 // @2a6 #998: RETURN
// #999: ;
// #1000: ;Delay of 40us.
// #1001: ;
// #1002: ;Registers used s0, s1
// #1003: ;
// @2a7 #1004: [delay_40us]
00128 // @2a7 #1004: LOAD(s1,40) ;40 x 1us = 40us
// @2a8 #1005: [wait_40us]
302a3 // @2a8 #1005: CALL(delay_1us)
1c101 // @2a9 #1006: SUB(s1,1)
356a8 // @2aa #1007: JUMP(NZ,wait_40us)
2a000 // @2ab #1008: RETURN
// #1009: ;
// #1010: ;
// #1011: ;Delay of 1ms.
// #1012: ;
// #1013: ;Registers used s0, s1, s2
// #1014: ;
// @2ac #1015: [delay_1ms]
00219 // @2ac #1015: LOAD(s2,25) ;25 x 40us = 1ms
// @2ad #1016: [wait_1ms]
302a7 // @2ad #1016: CALL(delay_40us)
1c201 // @2ae #1017: SUB(s2,1)
356ad // @2af #1018: JUMP(NZ,wait_1ms)
2a000 // @2b0 #1019: RETURN
// #1020: ;
// #1021: ;Delay of 20ms.
// #1022: ;
// #1023: ;Delay of 20ms used during initialisation.
// #1024: ;
// #1025: ;Registers used s0, s1, s2, s3
// #1026: ;
// @2b1 #1027: [delay_20ms]
00314 // @2b1 #1027: LOAD(s3,20) ;20 x 1ms = 20ms
// @2b2 #1028: [wait_20ms]
302ac // @2b2 #1028: CALL(delay_1ms)
1c301 // @2b3 #1029: SUB(s3,1)
356b2 // @2b4 #1030: JUMP(NZ,wait_20ms)
2a000 // @2b5 #1031: RETURN
// #1032: ;
// #1033: ;Delay of approximately 1 second.
// #1034: ;
// #1035: ;Registers used s0, s1, s2, s3, s4
// #1036: ;
// @2b6 #1037: [delay_1s]
00432 // @2b6 #1037: LOAD(s4,50) ;50 x 20ms = 1000ms
// @2b7 #1038: [wait_1s]
302b1 // @2b7 #1038: CALL(delay_20ms)
1c401 // @2b8 #1039: SUB(s4,1)
356b7 // @2b9 #1040: JUMP(NZ,wait_1s)
2a000 // @2ba #1041: RETURN
// #1042: ;
// #1043: ;
// #1044: ;
// #1045: ;**************************************************************************************
// #1046: ;LCD Character Module Routines
// #1047: ;**************************************************************************************
// #1048: ;
// #1049: ;LCD module is a 16 character by 2 line display but all displays are very similar
// #1050: ;The 4-wire data interface will be used (DB4 to DB7).
// #1051: ;
// #1052: ;The LCD modules are relatively slow and software delay loops are used to slow down
// #1053: ;KCPSM3 adequately for the LCD to communicate. The delay routines are provided in
// #1054: ;a different section (see above in this case).
// #1055: ;
// #1056: ;
// #1057: ;Pulse LCD enable signal 'E' high for greater than 230ns (1us is used).
// #1058: ;
// #1059: ;Register s4 should define the current state of the LCD output port.
// #1060: ;
// #1061: ;Registers used s0, s4
// #1062: ;
// @2bb #1063: [LCD_pulse_E]
0e401 // @2bb #1063: XOR(s4,LCD_E) ;E=1
2c440 // @2bc #1064: OUTPUT(s4,LCD_output_port)
302a3 // @2bd #1065: CALL(delay_1us)
0e401 // @2be #1066: XOR(s4,LCD_E) ;E=0
2c440 // @2bf #1067: OUTPUT(s4,LCD_output_port)
2a000 // @2c0 #1068: RETURN
// #1069: ;
// #1070: ;Write 4-bit instruction to LCD display.
// #1071: ;
// #1072: ;The 4-bit instruction should be provided in the upper 4-bits of register s4.
// #1073: ;Note that this routine does not release the master enable but as it is only
// #1074: ;used during initialisation and as part of the 8-bit instruction write it
// #1075: ;should be acceptable.
// #1076: ;
// #1077: ;Registers used s4
// #1078: ;
// @2c1 #1079: [LCD_write_inst4]
0a4f8 // @2c1 #1079: AND(s4,F8) ;Enable=1 RS=0 Instruction, RW=0 Write, E=0
2c440 // @2c2 #1080: OUTPUT(s4,LCD_output_port) ;set up RS and RW >40ns before enable pulse
302bb // @2c3 #1081: CALL(LCD_pulse_E)
2a000 // @2c4 #1082: RETURN
// #1083: ;
// #1084: ;
// #1085: ;Write 8-bit instruction to LCD display.
// #1086: ;
// #1087: ;The 8-bit instruction should be provided in register s5.
// #1088: ;Instructions are written using the following sequence
// #1089: ; Upper nibble
// #1090: ; wait >1us
// #1091: ; Lower nibble
// #1092: ; wait >40us
// #1093: ;
// #1094: ;Registers used s0, s1, s4, s5
// #1095: ;
// @2c5 #1096: [LCD_write_inst8]
01450 // @2c5 #1096: LOAD(s4,s5)
0a4f0 // @2c6 #1097: AND(s4,F0) ;Enable=0 RS=0 Instruction, RW=0 Write, E=0
0c408 // @2c7 #1098: OR(s4,LCD_drive) ;Enable=1
302c1 // @2c8 #1099: CALL(LCD_write_inst4) ;write upper nibble
302a3 // @2c9 #1100: CALL(delay_1us) ;wait >1us
01450 // @2ca #1101: LOAD(s4,s5) ;select lower nibble with
20407 // @2cb #1102: SL1(s4) ;Enable=1
20406 // @2cc #1103: SL0(s4) ;RS=0 Instruction
20406 // @2cd #1104: SL0(s4) ;RW=0 Write
20406 // @2ce #1105: SL0(s4) ;E=0
302c1 // @2cf #1106: CALL(LCD_write_inst4) ;write lower nibble
302a7 // @2d0 #1107: CALL(delay_40us) ;wait >40us
004f0 // @2d1 #1108: LOAD(s4,F0) ;Enable=0 RS=0 Instruction, RW=0 Write, E=0
2c440 // @2d2 #1109: OUTPUT(s4,LCD_output_port) ;Release master enable
2a000 // @2d3 #1110: RETURN
// #1111: ;
// #1112: ;
// #1113: ;
// #1114: ;Write 8-bit data to LCD display.
// #1115: ;
// #1116: ;The 8-bit data should be provided in register s5.
// #1117: ;Data bytes are written using the following sequence
// #1118: ; Upper nibble
// #1119: ; wait >1us
// #1120: ; Lower nibble
// #1121: ; wait >40us
// #1122: ;
// #1123: ;Registers used s0, s1, s4, s5
// #1124: ;
// @2d4 #1125: [LCD_write_data]
01450 // @2d4 #1125: LOAD(s4,s5)
0a4f0 // @2d5 #1126: AND(s4,F0) ;Enable=0 RS=0 Instruction, RW=0 Write, E=0
0c40c // @2d6 #1127: OR(s4,12) ;Enable=1 RS=1 Data, RW=0 Write, E=0
2c440 // @2d7 #1128: OUTPUT(s4,LCD_output_port) ;set up RS and RW >40ns before enable pulse
302bb // @2d8 #1129: CALL(LCD_pulse_E) ;write upper nibble
302a3 // @2d9 #1130: CALL(delay_1us) ;wait >1us
01450 // @2da #1131: LOAD(s4,s5) ;select lower nibble with
20407 // @2db #1132: SL1(s4) ;Enable=1
20407 // @2dc #1133: SL1(s4) ;RS=1 Data
20406 // @2dd #1134: SL0(s4) ;RW=0 Write
20406 // @2de #1135: SL0(s4) ;E=0
2c440 // @2df #1136: OUTPUT(s4,LCD_output_port) ;set up RS and RW >40ns before enable pulse
302bb // @2e0 #1137: CALL(LCD_pulse_E) ;write lower nibble
302a7 // @2e1 #1138: CALL(delay_40us) ;wait >40us
004f0 // @2e2 #1139: LOAD(s4,F0) ;Enable=0 RS=0 Instruction, RW=0 Write, E=0
2c440 // @2e3 #1140: OUTPUT(s4,LCD_output_port) ;Release master enable
2a000 // @2e4 #1141: RETURN
// #1142: ;
// #1143: ;
// #1144: ;
// #1145: ;
// #1146: ;Read 8-bit data from LCD display.
// #1147: ;
// #1148: ;The 8-bit data will be read from the current LCD memory address
// #1149: ;and will be returned in register s5.
// #1150: ;It is advisable to set the LCD address (cursor position) before
// #1151: ;using the data read for the first time otherwise the display may
// #1152: ;generate invalid data on the first read.
// #1153: ;
// #1154: ;Data bytes are read using the following sequence
// #1155: ; Upper nibble
// #1156: ; wait >1us
// #1157: ; Lower nibble
// #1158: ; wait >40us
// #1159: ;
// #1160: ;Registers used s0, s1, s4, s5
// #1161: ;
// #1162: ;LCD_read_data8: LOAD s4, 0E ;Enable=1 RS=1 Data, RW=1 Read, E=0
// #1163: ; OUTPUT s4, LCD_output_port ;set up RS and RW >40ns before enable pulse
// #1164: ; XOR s4, LCD_E ;E=1
// #1165: ; OUTPUT s4, LCD_output_port
// #1166: ; CALL delay_1us ;wait >260ns to access data
// #1167: ; INPUT s5, LCD_input_port ;read upper nibble
// #1168: ; XOR s4, LCD_E ;E=0
// #1169: ; OUTPUT s4, LCD_output_port
// #1170: ; CALL delay_1us ;wait >1us
// #1171: ; XOR s4, LCD_E ;E=1
// #1172: ; OUTPUT s4, LCD_output_port
// #1173: ; CALL delay_1us ;wait >260ns to access data
// #1174: ; INPUT s0, LCD_input_port ;read lower nibble
// #1175: ; XOR s4, LCD_E ;E=0
// #1176: ; OUTPUT s4, LCD_output_port
// #1177: ; AND s5, F0 ;merge upper and lower nibbles
// #1178: ; SR0 s0
// #1179: ; SR0 s0
// #1180: ; SR0 s0
// #1181: ; SR0 s0
// #1182: ; OR s5, s0
// #1183: ; LOAD s4, 04 ;Enable=0 RS=1 Data, RW=0 Write, E=0
// #1184: ; OUTPUT s4, LCD_output_port ;Stop reading 5V device and release master enable
// #1185: ; CALL delay_40us ;wait >40us
// #1186: ; RETURN
// #1187: ;
// #1188: ;
// #1189: ;Reset and initialise display to communicate using 4-bit data mode
// #1190: ;Includes routine to clear the display.
// #1191: ;
// #1192: ;Requires the 4-bit instructions 3,3,3,2 to be sent with suitable delays
// #1193: ;following by the 8-bit instructions to set up the display.
// #1194: ;
// #1195: ; 28 = '001' Function set, '0' 4-bit mode, '1' 2-line, '0' 5x7 dot matrix, 'xx'
// #1196: ; 06 = '000001' Entry mode, '1' increment, '0' no display shift
// #1197: ; 0C = '00001' Display control, '1' display on, '0' cursor off, '0' cursor blink off
// #1198: ; 01 = '00000001' Display clear
// #1199: ;
// #1200: ;Registers used s0, s1, s2, s3, s4
// #1201: ;
// @2e5 #1202: [LCD_reset]
302b1 // @2e5 #1202: CALL(delay_20ms) ;wait more that 15ms for display to be ready
00430 // @2e6 #1203: LOAD(s4,48)
302c1 // @2e7 #1204: CALL(LCD_write_inst4) ;send '3'
302b1 // @2e8 #1205: CALL(delay_20ms) ;wait >4.1ms
302c1 // @2e9 #1206: CALL(LCD_write_inst4) ;send '3'
302ac // @2ea #1207: CALL(delay_1ms) ;wait >100us
302c1 // @2eb #1208: CALL(LCD_write_inst4) ;send '3'
302a7 // @2ec #1209: CALL(delay_40us) ;wait >40us
00420 // @2ed #1210: LOAD(s4,32)
302c1 // @2ee #1211: CALL(LCD_write_inst4) ;send '2'
302a7 // @2ef #1212: CALL(delay_40us) ;wait >40us
00528 // @2f0 #1213: LOAD(s5,40) ;Function set
302c5 // @2f1 #1214: CALL(LCD_write_inst8)
00506 // @2f2 #1215: LOAD(s5,6) ;Entry mode
302c5 // @2f3 #1216: CALL(LCD_write_inst8)
0050c // @2f4 #1217: LOAD(s5,12) ;Display control
302c5 // @2f5 #1218: CALL(LCD_write_inst8)
// @2f6 #1219: [LCD_clear]
00501 // @2f6 #1219: LOAD(s5,1) ;Display clear
302c5 // @2f7 #1220: CALL(LCD_write_inst8)
302ac // @2f8 #1221: CALL(delay_1ms) ;wait >1.64ms for display to clear
302ac // @2f9 #1222: CALL(delay_1ms)
00513 // @2fa #1223: LOAD(s5,19)
30313 // @2fb #1224: CALL(LCD_cursor)
0053a // @2fc #1225: LOAD(s5,58) ;;;;;;;;;;;;;;;;;;;;;;; :
302d4 // @2fd #1226: CALL(LCD_write_data)
00516 // @2fe #1227: LOAD(s5,22)
30313 // @2ff #1228: CALL(LCD_cursor)
0052d // @300 #1229: LOAD(s5,45) ;;;;;;;;;;;;;;;;;;;;;; -
302d4 // @301 #1230: CALL(LCD_write_data)
00520 // @302 #1231: LOAD(s5,32)
30313 // @303 #1232: CALL(LCD_cursor)
0052d // @304 #1233: LOAD(s5,45) ;;;;;;;;;;;;;;;;;;;;;; -
302d4 // @305 #1234: CALL(LCD_write_data)
0052d // @306 #1235: LOAD(s5,45) ;;;;;;;;;;;;;;;;;;;;;; -
302d4 // @307 #1236: CALL(LCD_write_data)
0052d // @308 #1237: LOAD(s5,45) ;;;;;;;;;;;;;;;;;;;;;; -
302d4 // @309 #1238: CALL(LCD_write_data)
00528 // @30a #1239: LOAD(s5,40)
30313 // @30b #1240: CALL(LCD_cursor)
0052f // @30c #1241: LOAD(s5,47) ;;;;;;;;;;;;;;;;;;;;;; /
302d4 // @30d #1242: CALL(LCD_write_data)
0052b // @30e #1243: LOAD(s5,43)
30313 // @30f #1244: CALL(LCD_cursor)
0052f // @310 #1245: LOAD(s5,47) ;;;;;;;;;;;;;;;;;;;;;; -
302d4 // @311 #1246: CALL(LCD_write_data)
2a000 // @312 #1247: RETURN
// #1248: ;
// #1249: ;Position the cursor ready for characters to be written.
// #1250: ;The display is formed of 2 lines of 16 characters and each
// #1251: ;position has a corresponding address as indicated below.
// #1252: ;
// #1253: ; Character position
// #1254: ; 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
// #1255: ;
// #1256: ; Line 1 - 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
// #1257: ; Line 2 - C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
// #1258: ;
// #1259: ;This routine will set the cursor position using the value provided
// #1260: ;in register s5. The upper nibble will define the line and the lower
// #1261: ;nibble the character position on the line.
// #1262: ; Example s5 = 2B will position the cursor on line 2 position 11
// #1263: ;
// #1264: ;Registers used s0, s1, s2, s3, s4
// #1265: ;
// @313 #1266: [LCD_cursor]
12510 // @313 #1266: TEST(s5,16) ;test for line 1
35319 // @314 #1267: JUMP(Z,set_line2)
0a50f // @315 #1268: AND(s5,15) ;make address in range 80 to 8F for line 1
0c580 // @316 #1269: OR(s5,128)
302c5 // @317 #1270: CALL(LCD_write_inst8) ;instruction write to set cursor
2a000 // @318 #1271: RETURN
// @319 #1272: [set_line2]
0a50f // @319 #1272: AND(s5,15) ;make address in range C0 to CF for line 2
0c5c0 // @31a #1273: OR(s5,C0)
302c5 // @31b #1274: CALL(LCD_write_inst8) ;instruction write to set cursor
2a000 // @31c #1275: RETURN
// #1276: ;
// #1277: ;This routine will shift the complete display one position to the left.
// #1278: ;The cursor position and LCD memory contents will not change.
// #1279: ;
// #1280: ;
// #1281: ;Registers used s0, s1, s2, s3, s4, s5
// #1282: ;
// #1283: ;LCD_shift_left: LOAD s5, 18 ;shift display left
// #1284: ; CALL LCD_write_inst8
// #1285: ; RETURN
// #1286: ;
// #1287: ;**************************************************************************************
// #1288: ;Interrupt Service Routine (ISR)
// #1289: ;**************************************************************************************
// @31d #1290: [ISR]
2e001 // @31d #1290: STORE(s0,ISR_s0) ;preserve s0
2e112 // @31e #1291: STORE(s1,ISR_s1)
2e215 // @31f #1292: STORE(s2,ISR_s2)
04101 // @320 #1293: INPUT(s1,rotary_port)
00000 // @321 #1294: LOAD(s0,0)
12102 // @322 #1295: TEST(s1,rotary_press)
35331 // @323 #1296: JUMP(Z,no_press)
06017 // @324 #1297: FETCH(s0,pressed)
14000 // @325 #1298: COMPARE(s0,0)
35731 // @326 #1299: JUMP(NZ,no_press)
06202 // @327 #1300: FETCH(s2,LED_pattern)
18201 // @328 #1301: ADD(s2,1)
2e202 // @329 #1302: STORE(s2,LED_pattern)
06203 // @32a #1303: FETCH(s2,mode)
18201 // @32b #1304: ADD(s2,1)
14207 // @32c #1305: COMPARE(s2,7)
3572f // @32d #1306: JUMP(NZ,mode_save)
0a200 // @32e #1307: AND(s2,0)
// @32f #1308: [mode_save]
2e203 // @32f #1308: STORE(s2,mode) ;;;;;0-normal;1-hour;2-min;3-sec;4-day,5-mon,6-year
000ff // @330 #1309: LOAD(s0,FF)
// @331 #1310: [no_press]
2e017 // @331 #1310: STORE(s0,pressed)
12140 // @332 #1311: TEST(s1,64) ;;;rotary INT ?
353b3 // @333 #1312: JUMP(Z,T2_5m_INT) ;;NOT rotary INT,JUMP away
// @334 #1313: [CLR_INT2]
00040 // @334 #1313: LOAD(s0,64) ;;;;;CLR_INT1
2c020 // @335 #1314: OUTPUT(s0,32)
06002 // @336 #1315: FETCH(s0,LED_pattern)
12101 // @337 #1316: TEST(s1,rotary_left)
35374 // @338 #1317: JUMP(Z,ITS_RIGHT)
180ff // @339 #1318: ADD(s0,FF)
2e002 // @33a #1319: STORE(s0,LED_pattern)
// #1320: ;;;turn left,--
06003 // @33b #1321: FETCH(s0,mode)
14000 // @33c #1322: COMPARE(s0,0)
353b1 // @33d #1323: JUMP(Z,CLR_INT1) ;
14001 // @33e #1324: COMPARE(s0,1)
35747 // @33f #1325: JUMP(NZ,MODE2N)
06121 // @340 #1326: FETCH(s1,hourB)
181ff // @341 #1327: ADD(s1,FF)
141ff // @342 #1328: COMPARE(s1,FF) ;;;24
35745 // @343 #1329: JUMP(NZ,SAVE_HHN)
00117 // @344 #1330: LOAD(s1,23)
// @345 #1331: [SAVE_HHN]
2e121 // @345 #1331: STORE(s1,hourB)
343ee // @346 #1332: JUMP(real_time_end)
// @347 #1333: [MODE2N]
14002 // @347 #1333: COMPARE(s0,2)
35750 // @348 #1334: JUMP(NZ,MODE3N)
06122 // @349 #1335: FETCH(s1,minB)
181ff // @34a #1336: ADD(s1,FF)
141ff // @34b #1337: COMPARE(s1,FF) ;;;3C;;60
3574e // @34c #1338: JUMP(NZ,SAVE_MMN)
0013b // @34d #1339: LOAD(s1,59)
// @34e #1340: [SAVE_MMN]
2e122 // @34e #1340: STORE(s1,minB)
343ee // @34f #1341: JUMP(real_time_end)
// @350 #1342: [MODE3N]
14003 // @350 #1342: COMPARE(s0,3)
35759 // @351 #1343: JUMP(NZ,MODE4N)
06123 // @352 #1344: FETCH(s1,secB)
181ff // @353 #1345: ADD(s1,FF)
141ff // @354 #1346: COMPARE(s1,FF) ;;;60
35757 // @355 #1347: JUMP(NZ,SAVE_SSN)
0013b // @356 #1348: LOAD(s1,59)
// @357 #1349: [SAVE_SSN]
2e123 // @357 #1349: STORE(s1,secB)
343ee // @358 #1350: JUMP(real_time_end)
// @359 #1351: [MODE4N]
14004 // @359 #1351: COMPARE(s0,4)
35762 // @35a #1352: JUMP(NZ,MODE5N)
06125 // @35b #1353: FETCH(s1,monB)
181ff // @35c #1354: ADD(s1,FF)
14100 // @35d #1355: COMPARE(s1,0) ;;;12
35760 // @35e #1356: JUMP(NZ,SAVE_MONN)
0010c // @35f #1357: LOAD(s1,12)
// @360 #1358: [SAVE_MONN]
2e125 // @360 #1358: STORE(s1,monB)
343ee // @361 #1359: JUMP(real_time_end)
// @362 #1360: [MODE5N]
14005 // @362 #1360: COMPARE(s0,5)
3576b // @363 #1361: JUMP(NZ,MODE6N)
06126 // @364 #1362: FETCH(s1,dayB)
181ff // @365 #1363: ADD(s1,FF)
14100 // @366 #1364: COMPARE(s1,0) ;;;12
35769 // @367 #1365: JUMP(NZ,SAVE_DAYN)
06127 // @368 #1366: FETCH(s1,DMAX)
// @369 #1367: [SAVE_DAYN]
2e126 // @369 #1367: STORE(s1,dayB)
343ee // @36a #1368: JUMP(real_time_end)
// @36b #1369: [MODE6N]
14006 // @36b #1369: COMPARE(s0,6)
35773 // @36c #1370: JUMP(NZ,MODE7N)
06124 // @36d #1371: FETCH(s1,yearB)
181ff // @36e #1372: ADD(s1,FF)
141ff // @36f #1373: COMPARE(s1,FF) ;;;12
35772 // @370 #1374: JUMP(NZ,SAVE_YEARN)
00163 // @371 #1375: LOAD(s1,99)
// @372 #1376: [SAVE_YEARN]
2e124 // @372 #1376: STORE(s1,yearB)
// @373 #1377: [MODE7N]
343ee // @373 #1378: JUMP(real_time_end)
// @374 #1379: [ITS_RIGHT]
18001 // @374 #1379: ADD(s0,1)
2e002 // @375 #1380: STORE(s0,LED_pattern)
// #1381: ;;;turn right++
06003 // @376 #1382: FETCH(s0,mode)
14000 // @377 #1383: COMPARE(s0,0)
353b1 // @378 #1384: JUMP(Z,CLR_INT1) ;
14001 // @379 #1385: COMPARE(s0,1)
35782 // @37a #1386: JUMP(NZ,MODE2P)
06121 // @37b #1387: FETCH(s1,hourB)
18101 // @37c #1388: ADD(s1,1)
14118 // @37d #1389: COMPARE(s1,24) ;;;24
35780 // @37e #1390: JUMP(NZ,SAVE_HHP)
00100 // @37f #1391: LOAD(s1,0)
// @380 #1392: [SAVE_HHP]
2e121 // @380 #1392: STORE(s1,hourB)
343ee // @381 #1393: JUMP(real_time_end)
// @382 #1394: [MODE2P]
14002 // @382 #1394: COMPARE(s0,2)
3578b // @383 #1395: JUMP(NZ,MODE3P)
06122 // @384 #1396: FETCH(s1,minB)
18101 // @385 #1397: ADD(s1,1)
1413c // @386 #1398: COMPARE(s1,60) ;;;3C;;60
35789 // @387 #1399: JUMP(NZ,SAVE_MMP)
00100 // @388 #1400: LOAD(s1,0)
// @389 #1401: [SAVE_MMP]
2e122 // @389 #1401: STORE(s1,minB)
343ee // @38a #1402: JUMP(real_time_end)
// @38b #1403: [MODE3P]
14003 // @38b #1403: COMPARE(s0,3)
35794 // @38c #1404: JUMP(NZ,MODE4P)
06123 // @38d #1405: FETCH(s1,secB)
18101 // @38e #1406: ADD(s1,1)
1413c // @38f #1407: COMPARE(s1,60) ;;;60
35792 // @390 #1408: JUMP(NZ,SAVE_SSP)
00100 // @391 #1409: LOAD(s1,0)
// @392 #1410: [SAVE_SSP]
2e123 // @392 #1410: STORE(s1,secB)
343ee // @393 #1411: JUMP(real_time_end)
// @394 #1412: [MODE4P]
14004 // @394 #1412: COMPARE(s0,4)
3579d // @395 #1413: JUMP(NZ,MODE5P)
06125 // @396 #1414: FETCH(s1,monB)
18101 // @397 #1415: ADD(s1,1)
1410d // @398 #1416: COMPARE(s1,13) ;;;12
3579b // @399 #1417: JUMP(NZ,SAVE_MONP)
00101 // @39a #1418: LOAD(s1,1)
// @39b #1419: [SAVE_MONP]
2e125 // @39b #1419: STORE(s1,monB)
343ee // @39c #1420: JUMP(real_time_end)
// @39d #1421: [MODE5P]
14005 // @39d #1421: COMPARE(s0,5)
357a8 // @39e #1422: JUMP(NZ,MODE6P)
06126 // @39f #1423: FETCH(s1,dayB)
18101 // @3a0 #1424: ADD(s1,1)
06227 // @3a1 #1425: FETCH(s2,DMAX)
18201 // @3a2 #1426: ADD(s2,1)
15120 // @3a3 #1427: COMPARE(s1,s2)
357a6 // @3a4 #1428: JUMP(NZ,SAVE_DAYP)
00101 // @3a5 #1429: LOAD(s1,1)
// @3a6 #1430: [SAVE_DAYP]
2e126 // @3a6 #1430: STORE(s1,dayB)
343ee // @3a7 #1431: JUMP(real_time_end)
// @3a8 #1432: [MODE6P]
14006 // @3a8 #1432: COMPARE(s0,6)
357b0 // @3a9 #1433: JUMP(NZ,MODE7P)
06124 // @3aa #1434: FETCH(s1,yearB)
18101 // @3ab #1435: ADD(s1,1)
14164 // @3ac #1436: COMPARE(s1,100) ;;;12
357af // @3ad #1437: JUMP(NZ,SAVE_YEARP)
00100 // @3ae #1438: LOAD(s1,0)
// @3af #1439: [SAVE_YEARP]
2e124 // @3af #1439: STORE(s1,yearB)
// @3b0 #1440: [MODE7P]
343ee // @3b0 #1440: JUMP(real_time_end)
// @3b1 #1441: [CLR_INT1]
00040 // @3b1 #1441: LOAD(s0,64) ;;;;;CLR_INT1
2c020 // @3b2 #1442: OUTPUT(s0,32)
// #1443: ;;;TIMER interrupt process;;;;mode:::0-normal;1-hour;2-min;3-sec;4-day,5-mon,6-year
// @3b3 #1444: [T2_5m_INT]
12180 // @3b3 #1444: TEST(s1,128)
353f9 // @3b4 #1445: JUMP(Z,end_ISR)
00080 // @3b5 #1446: LOAD(s0,128) ;;;;;;;;;;clr_int2
2c020 // @3b6 #1447: OUTPUT(s0,32)
06004 // @3b7 #1448: FETCH(s0,ms1)
18001 // @3b8 #1449: ADD(s0,1)
2e004 // @3b9 #1450: STORE(s0,ms1)
14064 // @3ba #1451: COMPARE(s0,100)
357ee // @3bb #1452: JUMP(NZ,real_time_end)
0a000 // @3bc #1453: AND(s0,0) ;;;;;;;;;;;;;CLR ms1
2e004 // @3bd #1454: STORE(s0,ms1)
06002 // @3be #1455: FETCH(s0,LED_pattern) ;
18010 // @3bf #1456: ADD(s0,16)
2e002 // @3c0 #1457: STORE(s0,LED_pattern)
06111 // @3c1 #1458: FETCH(s1,ms500)
18101 // @3c2 #1459: ADD(s1,1)
2e111 // @3c3 #1460: STORE(s1,ms500)
14101 // @3c4 #1461: COMPARE(s1,1) ;
357c8 // @3c5 #1462: JUMP(NZ,CMP_2)
0002d // @3c6 #1463: LOAD(s0,45) ;;;------
343cf // @3c7 #1464: JUMP(CMP_4)
// @3c8 #1465: [CMP_2]
14102 // @3c8 #1465: COMPARE(s1,2) ;
357cc // @3c9 #1466: JUMP(NZ,CMP_3)
00060 // @3ca #1467: LOAD(s0,96) ;;;\\\\\\
343cf // @3cb #1468: JUMP(CMP_4)
// @3cc #1469: [CMP_3]
14103 // @3cc #1469: COMPARE(s1,3) ;
357cf // @3cd #1470: JUMP(NZ,CMP_4)
0007c // @3ce #1471: LOAD(s0,124) ;;;||||
// @3cf #1472: [CMP_4]
2e018 // @3cf #1472: STORE(s0,disp_flag)
14104 // @3d0 #1473: COMPARE(s1,4)
357ee // @3d1 #1474: JUMP(NZ,real_time_end)
0002f // @3d2 #1475: LOAD(s0,47) ;;;////
// #1476: ;;FETCH s0,disp_flag
// #1477: ;;ADD s0,01
2e018 // @3d3 #1478: STORE(s0,disp_flag)
0a100 // @3d4 #1479: AND(s1,0) ;;;;;;;;;;;;;CLR ms500
2e111 // @3d5 #1480: STORE(s1,ms500)
06023 // @3d6 #1481: FETCH(s0,secB) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CLOCK PROCESS START
18001 // @3d7 #1482: ADD(s0,1)
2e023 // @3d8 #1483: STORE(s0,secB)
1403c // @3d9 #1484: COMPARE(s0,60) ;;;60
357ee // @3da #1485: JUMP(NZ,real_time_end)
0a000 // @3db #1486: AND(s0,0)
2e023 // @3dc #1487: STORE(s0,secB)
06022 // @3dd #1488: FETCH(s0,minB)
18001 // @3de #1489: ADD(s0,1)
2e022 // @3df #1490: STORE(s0,minB)
1403c // @3e0 #1491: COMPARE(s0,60)
357ee // @3e1 #1492: JUMP(NZ,real_time_end)
0a000 // @3e2 #1493: AND(s0,0)
2e022 // @3e3 #1494: STORE(s0,minB)
// #1495: ;;;24 Hours
06021 // @3e4 #1496: FETCH(s0,hourB)
18001 // @3e5 #1497: ADD(s0,1)
2e021 // @3e6 #1498: STORE(s0,hourB)
14018 // @3e7 #1499: COMPARE(s0,24)
357ee // @3e8 #1500: JUMP(NZ,real_time_end)
0a000 // @3e9 #1501: AND(s0,0)
2e021 // @3ea #1502: STORE(s0,hourB)
// @3eb #1503: [DAY_P]
0601f // @3eb #1503: FETCH(s0,DAY_UP)
00001 // @3ec #1504: LOAD(s0,1)
2e01f // @3ed #1505: STORE(s0,DAY_UP)
// @3ee #1506: [real_time_end]
06010 // @3ee #1506: FETCH(s0,ms2) ;;;;;;;;2.5ms counter
18001 // @3ef #1507: ADD(s0,1)
14028 // @3f0 #1508: COMPARE(s0,40) ;;;;;;counter to 100ms
357f6 // @3f1 #1509: JUMP(NZ,store_ms2)
06113 // @3f2 #1510: FETCH(s1,ms100)
18101 // @3f3 #1511: ADD(s1,1)
// @3f4 #1512: [SAV_ms100]
2e113 // @3f4 #1512: STORE(s1,ms100)
00000 // @3f5 #1513: LOAD(s0,0)
// @3f6 #1514: [store_ms2]
2e010 // @3f6 #1514: STORE(s0,ms2)
06002 // @3f7 #1515: FETCH(s0,LED_pattern)
2c080 // @3f8 #1516: OUTPUT(s0,LED_port)
// @3f9 #1517: [end_ISR]
06001 // @3f9 #1517: FETCH(s0,ISR_s0) ;restore s0
06112 // @3fa #1518: FETCH(s1,ISR_s1) ;restore s1
06215 // @3fb #1519: FETCH(s2,ISR_s2) ;restore s2
38001 // @3fc #1520: RETURNI(ENABLE)
// #1521: ;**************************************************************************************
// #1522: ;Interrupt Vector
// #1523: ;**************************************************************************************
// #1524: ;
@3ff // #1525: ADDRESS(1023)
3431d // @3ff #1526: JUMP(ISR)
// #1527: ;First Screen:
// #1528: ;1234567890123456
// #1529: ; Clock Based
// #1530: ;S3E Starter kit
// #1531: ;Second Screen:
// #1532: ;1234567890123456
// #1533: ; X Xilinx
// #1534: ;PicoBlaze Test
// #1535: ;Third Screen:
// #1536: ;1234567890123456
// #1537: ; Press & Turn
// #1538: ;Encoder to Adjust
// #1539: ;1234567890123456
// #1540: ;09:00:00 Mon
// #1541: ;<-> 05/01/2006
// #1542: ;Based on Ken C's
// #1543: ;S3ESK_STARTUP
// #1544: ;Modified By
// #1545: ; George W.
// #1546: ;Dear Mr. Chapman,
// #1547: ;I have just finished a design with PicoBlaze Based the hardware of S3E Starter kit platform.
// #1548: ;It's amazing that the BicoBlaze works perfect,not bad than any other professional MCU I have ever used.I like it very much.
// #1549: ;I have used up all the programme space that MicroBlaze supports and I had to remove some functions from the designs for the programme space reason
// #1550: ;My question is ,wether can I make the programme counter wider in PicoBlaze to support more programme space.
// #1551: ;Another problem,I cannot update the PROM on the starter kit PCB,I'm not sure whether it is caused by the MCS file I generated or other problem.The screen shot and bitstream are attached.Please help me to have a check. Thank you.