0
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?

[例題の為の例題]一行分のダンプを表示せよ!!!(オンラインコンパイラ)

Posted at

いろいろ注意

  • 過去ログを見よ!!!
  • arduinoでの予定は、未定

目的

プログラム

  • オンラインコンパイラpaiza


#include <iostream>
using namespace std;
int main(void){
    // Your code here!
    char *b = "0123456789ABCDEF";  //16進の変換テーブル

    unsigned char RAM[256] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};

    int k = 0;

    printf("add  +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +A +B +C +D +E +F\n");

    putchar(b[k >> 12       ]);  //上位4ビットを表示
    putchar(b[k >>  8 & 0x0f]);  //12ビット目から4ビット
    putchar(b[k >>  4 & 0x0f]);  //8ビット目から4ビット
    putchar(b[k       & 0x0f]);  //下位4ビットを表示
    putchar(' ');
    
    for(int j = 0;j<16;j++){
        
        int a = RAM[k++];
        putchar(b[a >> 4       ]);  //上位4ビットを表示
        putchar(b[a      & 0x0f]);  //下位4ビットを表示
        putchar(' ');
    
    }  //for
    
    putchar('\n');
    
}  //main



add  +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +A +B +C +D +E +F
0000 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 

0
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
0
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?