68hc11

Interrupts IQR and XIRQ - assembly

吃可爱长大的小学妹 提交于 2020-07-09 12:06:14
问题 I've been struggling with a topic related to IRQ (interrupts itself); i'm using an old MC68HC11 Been practicing for a while; i decided to move on and check the hardest exercises showed in this chapter that's why i found an interesting one (and a little tricky tbh) Take a look at this: This is what i tried so far (This is just an outline ): Do NOTE: FLAGNMI means XIRQ FLAGIQR means IRQ IRQ EQU $FFF2 XIRQ EQU $FFF4 RESET EQU $FFFE RWM EQU $0000 ROM EQU $C000 LEDS EQU $1004 VARIABLE EQU $1003

Simple loop (reading temperature - MC68HC)

萝らか妹 提交于 2020-07-09 03:16:12
问题 I was reading a chapter related to I/O using the MC68HC11 ; this book showed a suggested exercise (not really a hard one) but i was not able to solve it by using assembly: I've been thinking and i can do it by using some basic logic (i do program in C and C++ ) but i got stuck while trying to do it in assembly. Logic goes like this: Loop: value = ReadSensorValue() if (value condition 1) // do action else if (value condition 2) // do something end if go to Loop Can help me to solve it but

Simple loop (reading temperature - MC68HC)

試著忘記壹切 提交于 2020-07-09 03:15:31
问题 I was reading a chapter related to I/O using the MC68HC11 ; this book showed a suggested exercise (not really a hard one) but i was not able to solve it by using assembly: I've been thinking and i can do it by using some basic logic (i do program in C and C++ ) but i got stuck while trying to do it in assembly. Logic goes like this: Loop: value = ReadSensorValue() if (value condition 1) // do action else if (value condition 2) // do something end if go to Loop Can help me to solve it but

Absolute values (assembly)

荒凉一梦 提交于 2020-06-28 06:44:11
问题 I want to obtain the absolute values of all the elements that are stored in a specific array (i'm using MC 68HC11) ABSOLUTE will contain the absolute values of the elements stored in ARRAY (the size of ABSOLUTE must be related to the amount of elements inside ARRAY) In C it looks like this: #include <stdio.h> #define SIZE 16 int absolute(int array[], int ray[], int N) { for (int i=0; i<N; i++) ray[i] = array[i] * (array[i]<0?-1:1); } int main() { int array[SIZE] = {0,1,2,3,-4,5,6,7,-8,9,-10

Absolute values (assembly)

回眸只為那壹抹淺笑 提交于 2020-06-28 06:44:09
问题 I want to obtain the absolute values of all the elements that are stored in a specific array (i'm using MC 68HC11) ABSOLUTE will contain the absolute values of the elements stored in ARRAY (the size of ABSOLUTE must be related to the amount of elements inside ARRAY) In C it looks like this: #include <stdio.h> #define SIZE 16 int absolute(int array[], int ray[], int N) { for (int i=0; i<N; i++) ray[i] = array[i] * (array[i]<0?-1:1); } int main() { int array[SIZE] = {0,1,2,3,-4,5,6,7,-8,9,-10

Positive, negative and zero (assembly)

混江龙づ霸主 提交于 2020-06-28 06:43:07
问题 I'm programming an old MCU (68hc11), I'm trying to migrate from C language to assembly code using the 68hc11 instructions. I want to write a program in assembly that counts the number of POSITIVE, NEGATIVE, and ZERO values that exist inside a given array. DO NOTE that all values inside ARRAY could be all positive or all negative or all zeros,do you get me? So I should define the size of the variables that will store the quantity properly. NOTE: The end of the array is: ARRAY+QUANTITY-1 Array:

Counting number (HC11)

半世苍凉 提交于 2020-06-27 10:52:11
问题 I'm still playing with this MC Now i want to count positive/negative numbers and 0's in a given array . In c, i did something like this and it worked perfectly: int A[15], pos, neg, nul, i; [...] pos = 0; neg = 0; nul = 0; for for (i = 0; i < 15; i++) { if (A[i] > 0) { pos++; } if (A[i] < 0) { neg++; } if (A[i] == 0) { nul++; } } So, the next step is to make something similar but in assembly code, i was thinking about this: RWM EQU $0 ROM EQU $C000 RESET EQU $FFFE QUANTITY EQU 200 ORG RWM

Counting number (HC11)

荒凉一梦 提交于 2020-06-27 10:51:50
问题 I'm still playing with this MC Now i want to count positive/negative numbers and 0's in a given array . In c, i did something like this and it worked perfectly: int A[15], pos, neg, nul, i; [...] pos = 0; neg = 0; nul = 0; for for (i = 0; i < 15; i++) { if (A[i] > 0) { pos++; } if (A[i] < 0) { neg++; } if (A[i] == 0) { nul++; } } So, the next step is to make something similar but in assembly code, i was thinking about this: RWM EQU $0 ROM EQU $C000 RESET EQU $FFFE QUANTITY EQU 200 ORG RWM

Counting number (HC11)

Deadly 提交于 2020-06-27 10:51:00
问题 I'm still playing with this MC Now i want to count positive/negative numbers and 0's in a given array . In c, i did something like this and it worked perfectly: int A[15], pos, neg, nul, i; [...] pos = 0; neg = 0; nul = 0; for for (i = 0; i < 15; i++) { if (A[i] > 0) { pos++; } if (A[i] < 0) { neg++; } if (A[i] == 0) { nul++; } } So, the next step is to make something similar but in assembly code, i was thinking about this: RWM EQU $0 ROM EQU $C000 RESET EQU $FFFE QUANTITY EQU 200 ORG RWM

Assembly language (arrays)

筅森魡賤 提交于 2020-06-15 05:09:27
问题 I'm new to assembly language and everything seems a little complicated. I'm programming an old MCU (68hc11), I'm trying to migrate from C language to assembly code using the 68hc11 instructions. I want to solve 2 different situations: FIRST CASE I want to write a program in assembly that counts the number of POSITIVE, NEGATIVE, and ZERO values that exist inside a given array. DO NOTE that all values inside ARRAY could be all positive or all negative or all zeros,do you get me? So I should