Чт ноя 24, 2022 09:20:26
;
; ** Mod10 - the function returns the modulo 10 of its argument value
;
public Mod10
Mod10:
;
; ** Div10 - the function returns its argument value divided by 10.
;
public Div10
Div10:
ld a, #10
div x, a
ret
Чт ноя 24, 2022 09:38:24
struct div {
int integer;
int remainder;
};
struct div Div10(int x)
{
struct div result;
result.integer = x / 10;
result.remainder = x % 10;
return result;
}
struct div xx = Div10(45);
Чт ноя 24, 2022 15:37:31
#include <stdlib.h>
...
div_t a = div(x, 10);