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?

More than 5 years have passed since last update.

plunkerでjor1k その2

Last updated at Posted at 2019-05-06

概要

plunkerでjor1kやってみた。
linuxプログラミングしてみた。

サンプルコード

# include <stdio.h>
# include <stdlib.h>

int main(int argc, char * argv[])
{
	int i;
	for (i = 1; i < argc; i++) 
	{
		printf("%s%s", (i == 1 ? "" : " "), argv[i]);
	}
	putchar('\n');
	exit(0);
}

結果

コンパイルエラーとなる。

~ $ cat main.c                                                                  
# include <stdio.h>                                                              
# include <stdlib.h>                                                             
                                                                                
int main(int argc, char * argv[])                                               
{                                                                               
         int i;                                                                 
         for (i = 1; i < argc; i++)                                             
         {                                                                      
                 printf("%s%s", (i == 1 ? "" : " "), argv[i]);                  
         }                                                                      
         putchar('\n');                                                         
         exit(0);                                                               
}                                                                               
                                                                                
~ $ gcc main.c                                                                  
/tmp/cccDMhHm.s: Assembler messages:                                            
/tmp/cccDMhHm.s:61: Error: operand out of range (1073741797 not between -3355443
2 and 33554431)                                                                 
~ $ 
~ $ uname -a                                                                    

Linux openrisc 4.16.0+ #10 Fri Jun 1 12:21:48 UTC 2018 openrisc GNU/Linux       

調査

こちらだと、成功する。https://cs-education.github.io/sys/#VM

image

以上。

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?