From 8d9769b95dd5ea2c01f434af2cdaad577a50a848 Mon Sep 17 00:00:00 2001 From: Bluepr1nt Date: Tue, 22 Mar 2016 14:39:20 +0100 Subject: [PATCH] assembly opdrachten --- MIC-Week1/.vs/MIC-Week1/v14/.atsuo | Bin 40448 -> 39936 bytes MIC-Week1/Debug/Makefile | 4 +- MIC-Week2/Debug/Makefile | 4 +- MIC-Week3/Debug/Makefile | 4 +- MIC-Week4/Debug/MIC-Week4.lss | 6 +- MIC-Week4/Debug/MIC-Week4.map | 30 +- MIC-Week4/Debug/Makefile | 4 +- MIC-Week4/Debug/lcd.d | 4 +- MIC-Week4/Debug/main.d | 4 +- MIC-Week5/MIC-Week5.cproj | 133 +-- MIC-Week6/Debug/MIC-Week6.lss | 1409 ++++++++++++++++++++++++++++ MIC-Week6/Debug/MIC-Week6.map | 871 +++++++++++++++++ MIC-Week6/Debug/MIC-Week6.tmp | 29 + MIC-Week6/MIC-Week6.asmproj | 20 +- MIC-Week6/main.asm | 60 +- 15 files changed, 2487 insertions(+), 95 deletions(-) create mode 100644 MIC-Week6/Debug/MIC-Week6.lss create mode 100644 MIC-Week6/Debug/MIC-Week6.map create mode 100644 MIC-Week6/Debug/MIC-Week6.tmp diff --git a/MIC-Week1/.vs/MIC-Week1/v14/.atsuo b/MIC-Week1/.vs/MIC-Week1/v14/.atsuo index 11027350a92e0a615e0f70cbc6e5db5ce3e82f55..afddd36fa15ade43ae3f1964bdee7f6a54f828cc 100644 GIT binary patch delta 332 zcmZqJ!_=^YX@UVG(?mmQM&`+koc|{#Y}v$=!@?Wz)_kc-%SA>-1_p)$lPj638P9G0 z%EZk$i9^Jd8z}Z43V48QUMOD-NdE(hO9N?FC>x}V1;|zaVyG4{#X0#Si!i4URFq?K zDa&j|zR7~D@{IgIXPlqJ#lvzID7jgHPlIvt5v~)91eg}_u}l*4;Lw8VnS4=6Wpat! zg~>pLlEbCBMwfe`a3h%?m%6;YV}5qKuYTPzqkp zerxe$$9!OAj`bJYeR`wZ&PgZy z4E-$8q@P&icU(y8Fg`~{h{)IB*@dMPqoIx>>P7l4DUu0tiIhm0NIpJS7*CQ)NB3x_ z$W?NU3=^rH=0gk445J*Wl3V|tUWs}&bf)ggjL)b)CojlLvPrhcEApCPrMGHHAu8#E z)?yIpSzC2W!XGQ2c|_-H7aF>umeJNt6=2!%wJby)Eo0y?@2ZEpZ6|F-wR&nGA@2sY zHMO0!c5Z%BsmqCk{f5C4oEGLCqlfNjA{V(9Rz^STK5F@dj^M11J=3!XDW-5bG>^T~ zG{S5h^;%iFer9hw%4Amd5s!vo*q1-YkB$un542nnuU+OxFtQf8VZZD_h`$Q!?z@}_ r3v9Sc?h%Ra(_*0*{O^c6aa1gAk2mmr^# + com.atmel.avrdbg.tool.simulator + + 0x1E9702 + + + + + + com.atmel.avrdbg.tool.simulator + + + Simulator + - -mmcu=atmega128 -B "%24(PackRepoDir)\atmel\ATmega_DFP\1.0.90\gcc\dev\atmega128" - True - True - True - True - True - False - True - True - - - NDEBUG - - - - - %24(PackRepoDir)\atmel\ATmega_DFP\1.0.90\include - - - Optimize for size (-Os) - True - True - True - - - libm - - - + -mmcu=atmega128 -B "%24(PackRepoDir)\atmel\ATmega_DFP\1.0.90\gcc\dev\atmega128" + True + True + True + True + True + False + True + True + + + NDEBUG + + + + + %24(PackRepoDir)\atmel\ATmega_DFP\1.0.90\include + + + Optimize for size (-Os) + True + True + True + + + libm + + + - -mmcu=atmega128 -B "%24(PackRepoDir)\atmel\ATmega_DFP\1.0.90\gcc\dev\atmega128" - True - True - True - True - True - False - True - True - - - DEBUG - - - - - %24(PackRepoDir)\atmel\ATmega_DFP\1.0.90\include - - - Optimize (-O1) - True - True - Default (-g2) - True - - - libm - - - Default (-Wa,-g) - + -mmcu=atmega128 -B "%24(PackRepoDir)\atmel\ATmega_DFP\1.0.90\gcc\dev\atmega128" + True + True + True + True + True + False + True + True + + + DEBUG + + + + + %24(PackRepoDir)\atmel\ATmega_DFP\1.0.90\include + + + Optimize (-O1) + True + True + Default (-g2) + True + + + libm + + + Default (-Wa,-g) + diff --git a/MIC-Week6/Debug/MIC-Week6.lss b/MIC-Week6/Debug/MIC-Week6.lss new file mode 100644 index 0000000..d507f1a --- /dev/null +++ b/MIC-Week6/Debug/MIC-Week6.lss @@ -0,0 +1,1409 @@ + +AVRASM ver. 2.1.57 C:\Users\martijn\Documents\GitHub\MIC-KM\MIC-Week6\main.asm Tue Mar 22 13:18:38 2016 + +[builtin](2): Including file 'C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.0.90\avrasm\inc\m128def.inc' +C:\Users\martijn\Documents\GitHub\MIC-KM\MIC-Week6\main.asm(10): Including file 'C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.0.90\avrasm\inc\m128def.inc' + + ; + + ;***** Created: 2011-02-09 12:03 ******* Source: ATmega128.xml *********** + ;************************************************************************* + ;* A P P L I C A T I O N N O T E F O R T H E A V R F A M I L Y + ;* + ;* Number : AVR000 + ;* File Name : "m128def.inc" + ;* Title : Register/Bit Definitions for the ATmega128 + ;* Date : 2011-02-09 + ;* Version : 2.35 + ;* Support E-mail : avr@atmel.com + ;* Target MCU : ATmega128 + ;* + ;* DESCRIPTION + ;* When including this file in the assembly program file, all I/O register + ;* names and I/O register bit names appearing in the data book can be used. + ;* In addition, the six registers forming the three data pointers X, Y and + ;* Z have been assigned names XL - ZH. Highest RAM address for Internal + ;* SRAM is also defined + ;* + ;* The Register names are represented by their hexadecimal address. + ;* + ;* The Register Bit names are represented by their bit number (0-7). + ;* + ;* Please observe the difference in using the bit names with instructions + ;* such as "sbr"/"cbr" (set/clear bit in register) and "sbrs"/"sbrc" + ;* (skip if bit in register set/cleared). The following example illustrates + ;* this: + ;* + ;* in r16,PORTB ;read PORTB latch + ;* sbr r16,(1< + 2.1.57 + "ATmega128" + C:\Users\martijn\Documents\GitHub\MIC-KM\MIC-Week6\Debug + + C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.0.90\avrasm\inc + C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.0.90\avrasm\inc + C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avrassembler\Include + + + C:\Users\martijn\Documents\GitHub\MIC-KM\MIC-Week6\main.asm + + C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.0.90\avrasm\inc\m128def.inc + + + C:\Users\martijn\Documents\GitHub\MIC-KM\MIC-Week6\Debug\MIC-Week6.obj + + + MIC-Week6.hex + + + MIC-Week6.map + MIC-Week6.lss + + +
C:\Users\martijn\Documents\GitHub\MIC-KM\MIC-Week6\main.asm19
+ C:\Users\martijn\Documents\GitHub\MIC-KM\MIC-Week6\main.asm87 +
+ diff --git a/MIC-Week6/MIC-Week6.asmproj b/MIC-Week6/MIC-Week6.asmproj index 066a29d..3f10a7b 100644 --- a/MIC-Week6/MIC-Week6.asmproj +++ b/MIC-Week6/MIC-Week6.asmproj @@ -20,12 +20,12 @@ false true true - + 0x20000000 true - + exception_table 2 - 1 + 0 @@ -38,6 +38,19 @@ + com.atmel.avrdbg.tool.simulator + + 0x1E9702 + + + + + + com.atmel.avrdbg.tool.simulator + + + Simulator + @@ -51,6 +64,7 @@ m128def.inc + Executable diff --git a/MIC-Week6/main.asm b/MIC-Week6/main.asm index b8396c6..bd8315e 100644 --- a/MIC-Week6/main.asm +++ b/MIC-Week6/main.asm @@ -16,8 +16,9 @@ .CSEG .ORG $0200 ; -main: ; -; 16 bits optelling: r5/r4 = r9/r8 + r7/r6 (23 ab + 44 98 = 68 43) +main: +; Opgave 0 ; +/*; 16 bits optelling: r5/r4 = r9/r8 + r7/r6 (23 ab + 44 98 = 68 43) ; Stap 1: tel de LSB?s op: r4 = r6+r8 mov r4, r8 ; r4 <- r8 add r4, r6 ; r4 <- r4+r6 misschien Carry gezet @@ -26,6 +27,61 @@ main: ; ; r3 = r5+r6+c mov r5, r9 ; r5 <- r9 adc r5, r7 ; r5 <- r5+r7+c + ; + ;*/ + ; +; Opgave 1 +/* ldi r16, $55 ; + sts $540, r16 ; + sts $541, r16 ; + sts $542, r16 ; + sts $543, r16 ; + sts $544, r16 ; + sts $545, r16 ; + sts $546, r16 ; + sts $547, r16 ; + sts $548, r16 ; + + ld r17*/ + ; +;Opgave 2 poging 1 + +/* ldi r16, $01 ; + ldi r17, $60 ; + ldi r18, $70 ; + +loop: + lds r4, r17 ; + com r4 ; + sts r17, r4 ; + add r17, r16 ; + cp r17, r18 ; + breq no_end ; + rjmp loop ;*/ + ldi r16, $01 ; + lds r17, $60 ; + com r17 + sts $60, r17 ; + lds r17, $61 ; + com r17 ; + lds r17, $62 ; + com r17 ; + lds r17, $63 ; + com r17 ; + lds r17, $64 ; + com r17 ; + lds r17, $65 ; + com r17 ; + lds r17, $66 ; + com r17 ; + lds r17, $67 ; + com r17 ; + lds r17, $68 ; + com r17 ; + lds r17, $69 ; + com r17 ; + lds r17, $70 ; + com r17 ; no_end: ; unlimited loop, when done