1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

1ドット4ビット系のVRAMの座標からアドレスの求め方

Posted at

x ほぼ、記事の紹介
x arduino UNO3での予定は、未定
x OR(オァー)を使うときは、0リセットを忘れずに

目的
座標変換
パレットカラー系は、今のところ使う予定は、ないが?
面白かったので紹介
キャリーフラグを上手く使っている(特に説明なし)

image_original (36).jpg


GetVramAdrs   MACRO
        ld    d, l
        ld    e, h
        srl   d
        rr    e
        ENDM

ld ロード命令
srl シフト命令
rr シフト命令

o_coq783.jpg

オンラインコンパイラ paiza



#include <iostream>
using namespace std;
int main(void){
    // Your code here!
    
    int h,l;
    int de;
    
    h = 20; //x
    l = 0;  //y
    
    de = 0;
    de = (l << 7) | (h >> 1); 
    
    printf("[%d][%d]->[%d]\n",h,l,de);
    
}




[20][0]->[10]


1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?